episcanpy.pl.correlation_matrix(adata, groupby, show_correlation_numbers=False, dendrogram=None, figsize=None, show=None, save=None, ax=None, **kwds)

Plots the correlation matrix computed as part of sc.tl.dendrogram.

adata : AnnDataAnnData

groupby : strstr

Categorical data column used to create the dendrogram

show_correlation_numbers : boolbool (default: False)

If show_correlation is True, plot the correlation number on top of each cell.

dendrogram : bool, str, NoneUnion[bool, str, None] (default: None)

If True or a valid dendrogram key, a dendrogram based on the hierarchical clustering between the groupby categories is added. The dendrogram information is computed using scanpy.tl.dendrogram(). If tl.dendrogram has not been called previously the function is called with default parameters.

figsize : Tuple[float, float], NoneOptional[Tuple[float, float]] (default: None)

By default a figure size that aims to produce a squared correlation matrix plot is used. Format is (width, height)



Only if show_correlation is True: Are passed to matplotlib.pyplot.pcolormesh() when plotting the correlation heatmap. Useful values to pas are vmax, vmin and cmap.

Return type

Axes, List[Axes]Union[Axes, List[Axes]]



>>> import scanpy as sc
>>> adata = sc.datasets.pbmc68k_reduced()
>>> sc.tl.dendrogram(adata, 'bulk_labels')
>>> sc.pl.correlation(adata, 'bulk_labels')