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 objectcluster_composition()returns, holding one cluster per feature.groupby (
str(default:'Metadata_Perturbation')) –obscolumn whose groups become the bars.ax (
Axes|None(default:None)) – Axes to draw on, orNonefor a new figure.
- Return type:
- Returns:
The axes when the caller passed
ax, elseNonebecause the plot then owns the figure it created. When returned they hold one bar per group ofgroupbyin the order the groups first appear and one stacked segment per cluster.- Raises:
KeyError –
obshas nogroupbycolumn.