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` 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: