sccoda.util.data_visualization.stacked_barplot¶
-
sccoda.util.data_visualization.
stacked_barplot
(data, feature_name, figsize=None, dpi=100, cmap=<matplotlib.colors.ListedColormap object>, plot_legend=True, level_order=None)¶ Plots a stacked barplot for all levels of a covariate or all samples (if feature_name==”samples”). Usage: plot_feature_stackbars(data, [“cov1”, “cov2”, “cov3”])
- Parameters
- data :
AnnData
AnnData
A scCODA compositional data object
- feature_name :
str
str
The name of the covariate to plot. If feature_name==”samples”, one bar for every sample will be plotted
- figsize :
Tuple
[int
,int
],None
Optional
[Tuple
[int
,int
]] (default:None
) figure size
- dpi :
int
,None
Optional
[int
] (default:100
) dpi setting
- cmap :
ListedColormap
,None
Optional
[ListedColormap
] (default:<matplotlib.colors.ListedColormap object at 0x7f132a83df40>
) The color map for the barplot
- plot_legend :
bool
,None
Optional
[bool
] (default:True
) If True, adds a legend
- level_order :
List
[str
],None
Optional
[List
[str
]] (default:None
) Custom ordering of bars on the x-axis
- data :
- Return type
- Returns
Returns a plot
g – a plot