scPyviewer.plot_bar#
- scPyviewer.plot_bar(ds, gene, group=None, figsize=(7.2, 4.4), dpi=150, error='sem', sort=None, palette=None, bar_width=0.8, edgecolor='black', edge_width=1.2, capsize=3.0, annotate=False, annotation_fmt='.2f', annotation_fontsize=8, title=None, title_fontsize=12, xlabel=None, ylabel=None, xlabel_fontsize=10, ylabel_fontsize=10, tick_fontsize=9, rotation=30, font_family=None)[source]#
Grouped comparison bar chart: mean gene expression per group ± error bar.
A publication-style quantitative bar plot (black-edged bars, error bars, optional value labels) — the single-cell analogue of the benchmark bar charts common in ML/biology papers.
- Parameters:
gene (str) – Gene whose mean expression is compared across groups.
group (str, optional) –
obsgrouping column (defaults tods.group_key).error ({"sem", "std", "none"}) – Error-bar statistic: standard error of the mean, standard deviation, or no error bars.
sort ({None, "ascending", "descending"}) – Order bars by mean expression, or keep category order (
None).palette (dict, optional) –
{label: color}override.bar_width (float) – Bar width (0–1).
edgecolor (str or None) – Bar outline colour (default
"black");Nonefor borderless.edge_width (float) – Bar outline / error-bar line width.
capsize (float) – Error-bar cap size in points.
annotate (bool) – Print each bar’s mean value above it.
annotation_fmt (str) – Format string for value labels (e.g.
".2f").annotation_fontsize (float) – Value-label font size.
title (str, optional) – Text overrides.
xlabel (str, optional) – Text overrides.
ylabel (str, optional) – Text overrides.
title_fontsize (float) – Font sizes.
xlabel_fontsize (float) – Font sizes.
ylabel_fontsize (float) – Font sizes.
tick_fontsize (float) – Font sizes.
rotation (int) – X-tick label rotation in degrees.
font_family (str, optional) – Font family for this figure only.
ds (Dataset)
figsize (tuple)
dpi (int)