scPyviewer.plot_trend#

scPyviewer.plot_trend(ds, gene, x, group=None, figsize=(7.6, 4.6), dpi=150, error='sem', show_band=True, band_alpha=0.18, linewidth=2.0, marker='o', markersize=5, palette=None, title=None, title_fontsize=12, xlabel=None, ylabel=None, xlabel_fontsize=10, ylabel_fontsize=10, tick_fontsize=9, rotation=0, legend_fontsize=8, legend_title_fontsize=9, font_family=None)[source]#

Trend line: mean gene expression along an ordered x variable.

One line per group level (e.g. cell type) across an ordered obs column such as timepoint or pseudotime bin, with a shaded error band.

Parameters:
  • gene (str) – Gene whose mean expression is tracked.

  • x (str) – Ordered obs column for the x-axis (numeric, or categorical whose category order defines the sequence).

  • group (str, optional) – obs column; one line per level. Pass the same column as x or a single-level column for a single line. Defaults to ds.group_key.

  • error ({"sem", "std", "none"}) – Error statistic for the shaded band.

  • show_band (bool) – Draw the ±error band around each line.

  • band_alpha (float) – Opacity of the error band.

  • linewidth (float) – Line width.

  • marker (str or None) – Point marker at each x position (None for lines only).

  • markersize (float) – Marker size.

  • palette (dict, optional) – {label: color} override.

  • 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.

  • legend_fontsize (float) – Legend font sizes.

  • legend_title_fontsize (float) – Legend font sizes.

  • font_family (str, optional) – Font family for this figure only.

  • ds (Dataset)

  • figsize (tuple)

  • dpi (int)