scPyviewer.plot_embedding#

scPyviewer.plot_embedding(ds, color=None, gene=None, embedding=None, figsize=(7.4, 5.6), dpi=150, point_size=3.0, alpha=0.75, cmap='viridis', title=None, title_fontsize=11, label_groups=True, label_fontsize=6, xlabel=None, ylabel=None, xlabel_fontsize=9, ylabel_fontsize=9, tick_fontsize=8, show_legend=True, legend_fontsize=7, legend_title=None, legend_title_fontsize=8, colorbar_label=None, colorbar_fontsize=8, font_family=None)[source]#

Scatter of a 2-D embedding colored by a metadata column or a gene.

Parameters:
  • color (str, optional) – obs column name (categorical or numeric).

  • gene (str, optional) – Gene name; expression drives the color scale.

  • embedding (str, optional) – Embedding key in obsm (e.g. "X_umap"). Auto-selected if None.

  • figsize (tuple) – Figure (width, height) in inches.

  • dpi (int) – Figure resolution (dots per inch).

  • point_size (float) – Scatter point diameter in points.

  • alpha (float) – Point transparency (0–1) for categorical coloring.

  • cmap (str) – Matplotlib colormap for continuous / gene coloring.

  • title (str, optional) – Override the auto-generated title.

  • title_fontsize (float) – Font size of the figure title.

  • label_groups (bool) – Overlay centroid text labels when coloring by category.

  • label_fontsize (float) – Font size of centroid group labels.

  • ylabel (str | None) – Override axis labels (default: embedding axis name).

  • ylabel_fontsize (float) – Axis-label font sizes.

  • tick_fontsize (float) – Tick-label font size.

  • show_legend (bool) – Show legend for categorical coloring when label_groups=False.

  • legend_fontsize (float) – Legend entry font size.

  • legend_title (str, optional) – Override legend title.

  • legend_title_fontsize (float) – Legend title font size.

  • colorbar_label (str, optional) – Override colorbar label in gene mode.

  • colorbar_fontsize (float) – Colorbar label and tick font size.

  • font_family (str, optional) – Font family for this figure only (e.g. "Arial").

  • ds (Dataset)

  • xlabel (str | None)

  • ylabel

  • xlabel_fontsize (float)

  • ylabel_fontsize