Main Content

addXLabel

Label x-axis of heatmap or clustergram

Description

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

example

addXLabel(hm_cg_object,label,Name,Value) specifies the label text object properties using name-value pair arguments. For example, addXLabel(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.

example

textObj = addXLabel(___) 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.

example

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 ]'

Figure HeatMap 1 contains 2 axes objects. Axes object 1 contains 178 objects of type image, rectangle. Hidden axes object 2 contains an object of type text.

Add a title to the heatmap in red.

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

Figure HeatMap 1 contains 2 axes objects. Axes object 1 contains 178 objects of type image, rectangle. Hidden axes object 2 contains an object of type text.

Change the title font size.

title.FontSize = 12;

Figure HeatMap 1 contains 2 axes objects. Axes object 1 contains 178 objects of type image, rectangle. Hidden axes object 2 contains an object of type text.

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

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

Figure HeatMap 1 contains 2 axes objects. Axes object 1 with xlabel Samples, ylabel Genes contains 178 objects of type image, rectangle. Hidden axes object 2 contains an object of type text.

Input Arguments

collapse all

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

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

Example: 'Samples'

Data Types: char | string

Output Arguments

collapse all

x-axis label, returned as a Text object.

Version History

Introduced in R2009b