heatmap
Create heatmap chart
Syntax
Description
Table Data
heatmap(
creates a heatmap by aggregating the variables in the table
tbl
,xvar
,yvar
)tbl
. Specify xvar
and
yvar
as the table variables that you want to visualize.
The numbers in the cells and the default colors correspond to the number of
times each (x, y) pair appears together in
the table. The resulting x-axis and y-axis
show unique values from the xvar
and yvar
variables respectively.
heatmap(
uses the table variable specified by tbl
,xvar
,yvar
,'ColorVariable',cvar
)cvar
to calculate the
numbers in the cells and the corresponding colors. The default calculation
method is a mean aggregation, so the cell numbers and colors are based on the
average value of cvar
for each (x,
y) pair that appears together in the table.
Matrix Data
heatmap(
creates a heatmap
from the 2-D matrix cdata
)cdata
, which contains pre-aggregated
data. The heatmap has one cell for each value in
cdata
.
Additional Options
heatmap(___,
specifies additional options for the heatmap using one or more name-value pair
arguments. Specify the options after all other input arguments. For a list of
properties, see HeatmapChart Properties.Name,Value
)
heatmap(
creates the heatmap in the figure, panel, or tab specified by
parent
,___)parent
.
returns
the h
= heatmap(___)HeatmapChart
object. Use h
to modify properties of the chart after creating
it. For a list of properties, see HeatmapChart Properties.
Examples
Input Arguments
Output Arguments
More About
Tips
To interactively explore the data in your heatmap, use these options.
Zoom — Use the scroll wheel or the + and - keys to zoom.
Pan — Click and drag the heatmap or use the arrow keys to pan across the rows or columns.
Data tips — Hover over the heatmap to display a data tip.
Rearrange rows and columns — Click and drag a row or column label to move it to a different position.
Sort values — Click the icon that appears when you hover over the row or column label. Click once to sort the values in ascending order, twice to sort the values in descending order, and a third time to reset the order.
If you create a heatmap chart from a table, then you can customize its data tips.
To add or remove a row from the data tip, right-click anywhere on the chart and point to Modify Data Tips. Then, select or deselect a variable.
To add or remove multiple rows, right-click on the chart, point to Modify Data Tips, and select More. Then, add variables by clicking >> or remove them by clicking <<.