, obs_keys=None, use_raw=None, show=None, save=None, **kwds)

Hierarchically-clustered heatmap.

Wraps seaborn.clustermap for AnnData.

adata : AnnData

Annotated data matrix.

obs_keys : str

Categorical annotation to plot with a different color map. Currently, only a single key is supported.

use_raw : bool, optional (default: None)

Use raw attribute of adata if present.


Show the plot, do not return axis.


If True or a str, save the figure. A string is appended to the default filename. Infer the filetype if ending on {‘.pdf’, ‘.png’, ‘.svg’}.


A matplotlib axes object. Only works if plotting a single component.

**kwds : keyword arguments

Keyword arguments passed to seaborn.clustermap.


If show == False, a seaborn.ClusterGrid object.


The returned object has a savefig() method that should be used if you want to save the figure object without clipping the dendrograms.

To access the reordered row indices, use: clustergrid.dendrogram_row.reordered_ind

Column indices, use: clustergrid.dendrogram_col.reordered_ind


Soon to come with figures. In the meanwile, see

>>> import scanpy.api as sc
>>> adata = sc.datasets.krumsiek11()
>>>, obs_keys='cell_type')