decoupler.pl.obsbar#
- decoupler.pl.obsbar(adata, y, hue=None, kw_barplot=None, **kwargs)#
Plot
adata.obsmetadata as a grouped barplot.- Parameters:
- adata
AnnData Annotated data matrix with observations (rows) and features (columns).
- y
str Column name in
adata.obsto plot in y axis.- hue
str|None(default:None) Column name in
adata.obsto color bars.- kw_barplot
dict|None(default:None) Keyword arguments passed to
seaborn.barplot.- ax
An existing
matplotlib.axes._axes.Axesinstance to plot on. IfNone, a new figure and axes will be created.- figsize
Size of the figure in inches as (width, height).
- dpi
Dots per inch for the figure resolution.
- return_fig
If
True, plotting methods should return the figure object instead of showing it.- save
If set, path to save the plot automatically to a file.
- adata
- Return type:
- Returns:
If
return_fig=True, returnsmatplotlib.figure.Figureinstance.
Example
import decoupler as dc adata, net = dc.ds.toy() dc.pl.obsbar(adata, y="sample", hue="sample")