scPyviewer.plot_correlation#
- scPyviewer.plot_correlation(ds, group=None, genes=None, method='pearson', figsize=None, dpi=150, cmap='RdBu_r', vmin=-1.0, vmax=1.0, annotate=True, annotation_fmt='.2f', annotation_fontsize=8, title=None, title_fontsize=11, tick_fontsize=9, colorbar_label=None, colorbar_fontsize=8, rotation=45, font_family=None)[source]#
Pairwise correlation matrix between groups (based on mean expression).
Better than
sc.pl.correlation_matrix:"pearson"or"spearman", value annotations in every cell,vmin/vmaxcontrol, and full font/size control.- Parameters:
group (str, optional) –
obscolumn whose categories become the matrix rows/cols.genes (list[str], optional) – Subset of genes used to compute correlations. Defaults to all genes.
method ({"pearson", "spearman"}) – Correlation method.
figsize (tuple, optional) – Figure
(width, height)in inches. Auto if None.dpi (int) – Resolution.
cmap (str) – Diverging colormap (e.g.
"vlag","RdBu_r").vmax (float) – Color-scale limits (default ±1).
annotate (bool) – Overlay correlation values in each cell.
annotation_fmt (str) – Format string for annotations.
annotation_fontsize (float) – Annotation font size.
title (str, optional) – Figure title.
title_fontsize (float) – Title font size.
tick_fontsize (float) – Tick-label font size.
colorbar_label (str, optional) – Override colorbar label.
colorbar_fontsize (float) – Colorbar text size.
rotation (int) – X-tick label rotation in degrees.
font_family (str, optional) – Font family for this figure only.
ds (Dataset)
vmin (float)
vmax