archetypes.visualization.heatmap#

archetypes.visualization.heatmap(data, coefficients=None, n=None, reorder=False, ax=None, **kwargs)#

Plot a heatmap of the data.

If coefficients are provided, the heatmap is reordered according to the coefficients.

Parameters:
data: np.ndarray

The data to plot.

coefficients: list of np.ndarray or None, default=None

The coefficients to use for sorting the data. If None, no sorting is applied.

n: int or None, default=None

If provided, only the n closest samples to each archetype are shown. Requires coefficients to be provided. If None, all samples are shown.

reorder: bool, optional

Whether to reorder the archetypal groups by size. Default is False.

ax: matplotlib.pyplot.axes or None

The axes to plot on. If None, a new figure and axes is created.

**paramsdict, optional

The parameters to pass to the matshow plot. ax.matshow(…, **params)

Returns
——-
ax: matplotlib.pyplot.axes

The axes.