Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Heatmap

Signature

sp.heatmap(title, labels=None, values=None, *, variant="basic", col_labels=None, **kwargs) -> Chart

Description

sp.heatmap() is the unified entry point for the entire heatmap family. The variant keyword selects the rendering strategy — every other argument stays consistent across variants. Cell colors are computed in pure Rust, no NumPy required. The matrix is passed as a flat list of length len(labels) * len(col_labels) (row-major).

Parameters

ParameterUsed by variants
col_labelsbubble, cluster, marginal, pivot, unequal
colorscaleconfusion
contour_levelscontour
discrete_stepsdiscrete
divergingbubble, marginal, pivot
flat_matrixbubble, cluster, marginal, pivot
heightbubble, marginal, pivot
hoverbubble, marginal, pivot
palettecategorical
row_labelsbubble, cluster, marginal, pivot, unequal
show_valuescategorical
titlebubble, marginal, pivot
widthbubble, marginal, pivot
x_widthsunequal
y_heightsunequal

Returns

Chart — object with .html property and .show() method.