cellrank.tl.estimators.GPCCA.plot_macrostate_composition

GPCCA.plot_macrostate_composition(key, width=0.8, title=None, labelrot=45, legend_loc='upper right out', figsize=None, dpi=None, save=None, show=True)[source]

Plot stacked histogram of macrostates over categorical annotations.

Parameters
  • adata (anndata.AnnData) – Annotated data object.

  • key (str) – Key from adata .obs containing categorical annotations.

  • width (float) – Bar width in [0, 1].

  • title (Optional[str]) – Title of the figure. If None, create one automatically.

  • labelrot (float) – Rotation of labels on x-axis.

  • legend_loc (Optional[str]) – Position of the legend. If None, don’t show legend.

  • figsize (Optional[Tuple[float, float]]) – Size of the figure.

  • dpi (Optional[int]) – Dots per inch.

  • save (Union[str, Path, None]) – Filename where to save the plot.

  • show (bool) – If False, return matplotlib.pyplot.Axes.

Return type

Optional[Axes]

Returns

  • matplotlib.pyplot.Axes – The axis object if show=False.

  • None – Nothing, just plots the figure. Optionally saves it based on save.