mantispy.pl.cluster_composition

mantispy.pl.cluster_composition#

mantispy.pl.cluster_composition(composition, groupby='Metadata_Perturbation', ax=None)[source]#

Stacked bars of cell-state fractions, averaged within each group.

Parameters:
  • composition (AnnData) – The well-level object cluster_composition() returns, holding one cluster per feature.

  • groupby (str (default: 'Metadata_Perturbation')) – obs column whose groups become the bars.

  • ax (Axes | None (default: None)) – Axes to draw on, or None for a new figure.

Return type:

Axes | None

Returns:

The axes when the caller passed ax, else None because the plot then owns the figure it created. When returned they hold one bar per group of groupby in the order the groups first appear and one stacked segment per cluster.

Raises:

KeyError – obs has no groupby column.