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 :
AnnDataAnnData A scCODA compositional data object
- feature_name :
strstr The name of the covariate to plot. If feature_name==”samples”, one bar for every sample will be plotted
- figsize :
Tuple[int,int],NoneOptional[Tuple[int,int]] (default:None) figure size
- dpi :
int,NoneOptional[int] (default:100) dpi setting
- cmap :
ListedColormap,NoneOptional[ListedColormap] (default:<matplotlib.colors.ListedColormap object at 0x7f132a83df40>) The color map for the barplot
- plot_legend :
bool,NoneOptional[bool] (default:True) If True, adds a legend
- level_order :
List[str],NoneOptional[List[str]] (default:None) Custom ordering of bars on the x-axis
- data :
- Return type
- Returns
Returns a plot
g – a plot