A stats.chart.HeatmapChart holds a matrix of values, the labels of
its columns and rows, and the choices it is drawn with, and redraws itself
whenever one of them is set. It is what heatmap returns, and the
documented way to reach it.
The values come either from a matrix or from a table, never from both.
From a table, each distinct value of XVariable is a column and each
distinct value of YVariable a row, and each cell holds the number of
rows of the table falling in it, or the mean, median, sum, minimum or
maximum of ColorVariable over them, as ColorMethod says.
Missing values of ColorVariable are left out of the mean, median,
sum, minimum and maximum, and counted by 'count'.
XData and YData name the columns and rows of ColorData.
XDisplayData and YDisplayData say which of them are shown and
in what order, and XDisplayLabels and YDisplayLabels what they
are called on the chart. ColorDisplayData is the matrix as shown.
A heatmap takes the place of the current axes of its parent, as MATLAB’s
does, keeping their outer position, and refuses axes on which
hold is on. A later plot into the figure takes the place of the
heatmap in turn.
MATLAB’s chart is a graphics object of its own. This one is a handle class
that draws into axes of its own, which become the current axes and are
deleted with it; when a later plot clears those axes the chart lets go of
them, and Parent and the drawing are gone. GridVisible,
ColorbarVisible and Visible hold 'on' or
'off' where MATLAB holds an on-off state.
parent is the figure or panel to place the chart in, or empty for
the current figure, which is resolved only once every value has been
accepted. spec is a structure carrying the data as
heatmap resolved it, with the fields ColorData,
XData, YData, SourceTable, XVariable,
YVariable and ColorVariable, and args the
name-value pairs left to set. The documented way to reach this
constructor is heatmap.
sortx (h) puts the columns in the order of their names.
sortx (h, row) puts them in the order of their values
in the row named row, an element of YData; a cell array of
rows sorts by the first, then by the next where the first ties.
direction is 'ascend', the default, or 'descend'.
Missing values go last when ascending and first when descending,
unless mp, 'first', 'last' or 'auto', says
otherwise. The new order is set as XDisplayData.