, groupby, *, dendrogram_key=None, orientation='top', remove_labels=False, show=None, save=None, ax=None)

Plots a dendrogram of the categories defined in groupby.

See dendrogram().

adata : AnnData

Annotated data matrix.

groupby : str

Categorical data column used to create the dendrogram

dendrogram_key : Optional[str] (default: None)

Key under with the dendrogram information was stored. By default the dendrogram information is stored under .uns[f'dendrogram_{groupby}'].

orientation : Literal[‘top’, ‘bottom’, ‘left’, ‘right’] (default: 'top')

Origin of the tree. Will grow into the opposite direction.

remove_labels : bool (default: False)

Don’t draw labels. Used e.g. by to annotate matrix columns/rows.

show : Optional[bool] (default: None)

Show the plot, do not return axis.

save : Union[str, bool, None] (default: None)

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'}.

ax : Optional[Axes] (default: None)

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




import scanpy as sc
adata = sc.datasets.pbmc68k_reduced(), 'bulk_labels'), 'bulk_labels')