episcanpy.api.pl.correlation_matrix¶
- episcanpy.api.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.
- Parameters
- adata :
AnnData
AnnData
- groupby :
str
str
Categorical data column used to create the dendrogram
- show_correlation_numbers :
bool
bool
(default:False
) If show_correlation is True, plot the correlation number on top of each cell.
- dendrogram :
bool
|str
|None
Union
[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
] |None
Optional
[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)
- {show_save_ax}
- **kwds
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.
- adata :
- Return type
- Returns
Examples
>>> import scanpy as sc >>> adata = sc.datasets.pbmc68k_reduced() >>> sc.tl.dendrogram(adata, 'bulk_labels') >>> sc.pl.correlation(adata, 'bulk_labels')