Main Content


Label y-axis of heatmap or clustergram



addYLabel(hm_cg_object,label) adds a label below the y-axis of the heatmap or clustergram.


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


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


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.


Input Arguments

collapse all

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

y-axis label, specified as a character vector or string.

Example: 'Genes'

Data Types: char | string

Output Arguments

collapse all

y-axis label, returned as a Text object.

Version History

Introduced in R2009b