dandelion.plotting.stackedbarplot¶
-
dandelion.plotting.
stackedbarplot
(self, color, groupby, figsize=(12, 4), normalize=False, title=None, sort_descending=True, xtick_rotation=None, hide_legend=True, legend_options=None, labels=None, min_clone_size=None, clone_key=None, **kwargs)[source]¶ A stackedbarplot function to plot usage of V/J genes in the data split by groups.
- Parameters
self (Dandelion, AnnData) – Dandelion or AnnData object.
color (str) – column name in metadata for plotting in bar plot.
groupby (str) – column name in metadata to split by during plotting.
figsize (Tuple[Union[int,float], Union[int,float]]) – figure size. Default is (12, 4).
normalize (bool) – if True, will return as proportion out of 1, otherwise False will return counts. Default is True.
sort_descending (bool) – whether or not to sort the order of the plot. Default is True.
title (str, optional) – title of plot.
xtick_rotation (Union[None, Union[float,int]] : int, float, optional) – rotation of x tick labels.
hide_legend (bool) – whether or not to hide the legend.
legend_options (Tuple[str, Tuple[float, float], int]) – a tuple holding 3 options for specify legend options: 1) loc (string), 2) bbox_to_anchor (tuple), 3) ncol (int).
labels (Sequence, optional) – Names of objects will be used for the legend if list of multiple dataframes supplied.
min_clone_size (int, optional) – minimum clone size to keep. Defaults to 1 if left as None.
clone_key (str, optional) – column name for clones. None defaults to ‘clone_id’.
**kwargs – other kwargs passed to matplotlib.plt.
- Returns
- Return type
stacked bar plot.