Main Content

addTitle

Add title to heatmap or clustergram

Description

example

addTitle(hm_cg_object,title) adds a title to the heatmap or clustergram.

example

addTitle(hm_cg_object,title,Name,Value) specifies the title text object properties using name-value pair arguments. For example, addTitle(hm_cg_object,'Gene Expression Data','Color','red','FontSize',12) displays the title in red 12-point font. You can specify multiple name-value pairs. Enclose each property name in quotes.

example

textObj = addTitle(___) returns a text object textObj used as the title of the heatmap or clustergram using any of the input argument combinations in the previous syntaxes.

Examples

collapse all

Load a sample of gene expression data.

load bc_train_filtered

Display a heatmap of the gene expression values for 4918 genes from 78 samples.

hmo = HeatMap(bcTrainData.Log10Ratio);
             Standardize: '[column | row | {none}]'
               Symmetric: '[true | false].'
            DisplayRange: 'Scalar.'
                Colormap: []
               ImputeFun: 'string -or- function handle -or- cell array'
            ColumnLabels: 'Cell array of strings, or an empty cell array'
               RowLabels: 'Cell array of strings, or an empty cell array'
      ColumnLabelsRotate: []
         RowLabelsRotate: []
                Annotate: '[on | {off}]'
          AnnotPrecision: []
              AnnotColor: []
       ColumnLabelsColor: 'A structure array.'
          RowLabelsColor: 'A structure array.'
       LabelsWithMarkers: '[true | false].'
    ColumnLabelsLocation: '[ top | {bottom} ]'
       RowLabelsLocation: '[ {left} | right ]'

Add a title to the heatmap in red.

title = addTitle(hmo,'Gene Expression Data','Color','red');

Change the title font size.

title.FontSize = 12;

Add labels to the x-axis and y-axis.

addXLabel(hmo,'Samples','FontSize',12);
addYLabel(hmo,'Genes','FontSize',12);

Input Arguments

collapse all

Heatmap or clustergram object, specified as a HeatMap object or clustergram object.

Title of the heatmap or clustergram, specified as a character vector or string.

Example: 'Inverse of an Upper Hessenberg Matrix'

Data Types: char | string

Output Arguments

collapse all

Heatmap or clustergram title, returned as a Text object.

Version History

Introduced in R2009b