Skip to content

Commit f417967

Browse files
Backport PR #4058 on branch 1.12.x (docs: add inline example plot to sc.pl.rank_genes_groups_violin) (#4067)
Co-authored-by: Ekin Kahraman <evk23umu@uea.ac.uk>
1 parent 1fce8f6 commit f417967

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/scanpy/plotting/_tools/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,18 @@ def rank_genes_groups_violin( # noqa: PLR0913
12911291
Size of the jitter points.
12921292
{show_save_ax}
12931293
1294+
Examples
1295+
--------
1296+
Plot violin distributions of top-ranked genes per group.
1297+
1298+
.. plot::
1299+
:context: close-figs
1300+
1301+
import scanpy as sc
1302+
adata = sc.datasets.pbmc68k_reduced()
1303+
sc.tl.rank_genes_groups(adata, "bulk_labels")
1304+
sc.pl.rank_genes_groups_violin(adata, groups=["CD34+"], n_genes=5)
1305+
12941306
"""
12951307
if key is None:
12961308
key = "rank_genes_groups"

0 commit comments

Comments
 (0)