HeatMap object

Object containing matrix and heat map display properties

Description

A HeatMap object contains data and display properties that you can view in a heat map (2-D color image).

Create a HeatMap object using the object constructor function HeatMap. View a graphical representation of the HeatMap object in a heat map using the view method.

The HeatMap class is a superclass of the clustergram class.

Method Summary

Following are methods of a HeatMap object:

addTitle (HeatMap)Add title to heat map
addXLabel (HeatMap)Label x-axis of heat map
addYLabel (HeatMap)Label y-axis of heat map
plot (HeatMap)Render heat map for HeatMap object
view (HeatMap)View heat map of HeatMap object

Property Summary

Properties for Heat Map Creation

Property NameDescription
Standardize

String or number specifying the dimension for standardizing the data values. The standardized values are transformed so that the mean is 0 and the standard deviation is 1 in the specified dimension. Choices are:

  • 'column' or 1 — Standardize along the columns of data.

  • 'row' or 2 — Standardize along the rows of data.

  • 'none' or 3 (default) — Do not standardize.

Colormap

Either of the following:

  • M-by-3 matrix of RGB values

  • Name or function handle of a function that returns a colormap, such as redgreencmap or redbluecmap

Default is redgreencmap.
DisplayRange

Positive scalar specifying the display range of standardized values. Default is the maximum absolute value in the input matrix.

For example, if you specify 3, there is a color variation for values between –3 and 3, but values >3 are the same color as 3, and values < –3 are the same color as –3.

For example, if you specify redgreencmap for the 'Colormap' property, pure red represents values ≥ DisplayRangeValue, and pure green represents values ≤ –DisplayRangeValue.

SymmetricForces the color scale of the heat map to be symmetric around zero. Choices are true (default) or false.
ImputeFun

One of the following:

  • Name of a function that imputes missing data.

  • Handle to a function that imputes missing data.

  • Cell array where the first element is the name of or handle to a function that imputes missing data. The remaining elements are property name/property value pairs used as inputs to the function.

Properties for Row and Column Labels

Property NameDescription
RowLabelsVector of numbers or cell array of text strings to label the rows in the heat map. Default is a vector of values 1 through M, where M is the number of rows in Data, the matrix of data used by the HeatMap function to create the HeatMap object.
ColumnLabelsVector of numbers or cell array of text strings to label the columns in the heat map. Default is a vector of values 1 through M, where M is the number of columns in Data, the matrix of data used by the HeatMap function to create the HeatMap object.
ColumnLabelsLocation

String specifying the location of the column labels. Choices are 'top' or 'bottom' (default).

RowLabelsLocation

String specifying the location of the row labels. Choices are 'left' (default) or 'right'.

RowLabelsColor

Structure or structure array containing color information for labeling the rows (y-axis) of the heat map. If a single structure, then the fields contain a cell array of elements. If a structure array, then the fields contain one element:

  • Labels — String specifying a row label listed in the RowLabels vector.

  • Colors — String or three-element vector of RGB values specifying a color for the row label specified in the Labels field. For more information on specifying colors, see ColorSpec. If this field is empty, default colors are assigned to the row label.

ColumnLabelsColor

Structure or structure array containing color information for labeling the columns (x-axis) of the heat map. If a single structure, then the fields contain a cell array of elements. If a structure array, then the fields contain one element:

  • Labels — String specifying a column label listed in the ColumnLabels vector.

  • Colors — String or three-element vector of RGB values specifying a color for the column label specified in the Labels field. For more information on specifying colors, see ColorSpec. If this field is empty, default colors are assigned to the column label.

LabelsWithMarkers

Controls the display of colored markers instead of colored text for the row labels and column labels. Choices are true or false (default).

RowLabelsRotate

Numeric value in degrees rotation specifying the orientation of row (y-axis) labels. Default is 0 degrees, which is horizontal. Positive values cause counterclockwise rotation.

ColumnLabelsRotate

Numeric value in degrees rotation specifying the orientation of column (x-axis) labels. Default is 90 degrees, which is vertical. Values greater than 90 degrees cause counterclockwise rotation.

Properties for Annotating Data

Property NameDescription
Annotate

Controls the display of intensity values on each area of the heat map. Choices are true or false (default).

AnnotPrecision

Positive integer specifying the precision of the intensity values when displayed on the heat map. Default is 2.

AnnotColor

String or three-element vector of RGB values specifying a color for the text of the intensity values when displayed on the heat map. Default is 'white'. For more information on specifying colors, see ColorSpec.

Examples

    Note:   The following examples use the get and set methods with property names and values of a HeatMap object. When supplying a PropertyName, be aware that it is case sensitive.

Determining Properties and Property Values of a HeatMap Object

Display all properties and their current values of a HeatMap object, HMobj:

get(HMobj)

Return all properties and their current values of HMobj, a HeatMap object, to CGstruct, a scalar structure in which each field name is a property of a HeatMap object, and each field contains the value of that property.

CGstruct = get(HMobj)

Return the value of a specific property of a HeatMap object, HMobj, using either:

PropertyValue = get(HMobj, 'PropertyName')
PropertyValue = HMobj.PropertyName

Return the value of specific properties of a HeatMap object, HMobj:

[Property1Value, Property2Value, ...] = get(HMobj, ...
'Property1Name', 'Property2Name', ...)

Determining Possible Values of HeatMap Object Properties

Display possible values for all properties that have a fixed set of property values in a HeatMap object, HMobj:

set(HMobj)

Display possible values for a specific property that has a fixed set of property values in a HeatMap object, HMobj:

set(HMobj,  'PropertyName')

Specifying Properties of a HeatMap Object

Set a specific property of a HeatMap object, HMobj, using either:

set(HMobj, 'PropertyName', PropertyValue)
HMobj.PropertyName = PropertyValue

Set multiple properties of a HeatMap object, HMobj:

set(HMobj,  'Property1Name', Property1Value, ...
    'Property2Name', Property2Value, ...)
Was this topic helpful?