From ef2e79da56b3d74f4651f945192606114907f90e Mon Sep 17 00:00:00 2001 From: CuiweiG <48gaocuiwei@gmail.com> Date: Tue, 21 Apr 2026 12:59:28 +0800 Subject: [PATCH 1/2] docs: add inline example plot to sc.pl.scatter The scatter docstring had no rendered example plot. Add one covering the two-continuous-variable case (counts vs genes, colored by a QC metric), using pbmc68k_reduced so no preprocessing is needed. Refs #1664 --- src/scanpy/plotting/_anndata.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/scanpy/plotting/_anndata.py b/src/scanpy/plotting/_anndata.py index b187891b31..a40d6b1b97 100755 --- a/src/scanpy/plotting/_anndata.py +++ b/src/scanpy/plotting/_anndata.py @@ -157,6 +157,17 @@ def scatter( # noqa: PLR0913 ------- If `show==False` a :class:`~matplotlib.axes.Axes` or a list of it. + Examples + -------- + Plot per-cell total counts versus detected genes, colored by mitochondrial fraction. + + .. plot:: + :context: close-figs + + import scanpy as sc + adata = sc.datasets.pbmc68k_reduced() + sc.pl.scatter(adata, x="n_counts", y="n_genes", color="percent_mito") + """ # color can be a obs column name or a matplotlib color specification (or a collection thereof) if color is not None: From bbd551c5dface320c8f06dde5ba511a61f649441 Mon Sep 17 00:00:00 2001 From: CuiweiG <48gaocuiwei@gmail.com> Date: Wed, 22 Apr 2026 05:50:49 +0800 Subject: [PATCH 2/2] docs: add release note fragment --- docs/release-notes/4078.docs.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/release-notes/4078.docs.md diff --git a/docs/release-notes/4078.docs.md b/docs/release-notes/4078.docs.md new file mode 100644 index 0000000000..fb3c54c1ec --- /dev/null +++ b/docs/release-notes/4078.docs.md @@ -0,0 +1 @@ +Add a rendered example plot to {func}`~scanpy.pl.scatter` showing a QC scatter using `pbmc68k_reduced` {smaller}`C Gao`