docs(plotting): add inline example plots for 4 sc.pl functions (#1664)#4103
Merged
flying-sheep merged 1 commit intoMay 8, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4103 +/- ##
=======================================
Coverage 79.61% 79.61%
=======================================
Files 120 120
Lines 12941 12941
=======================================
Hits 10303 10303
Misses 2638 2638
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…ing, paga_compare (scverse#1664) Adds Examples sections with `.. plot::` directives to four public plotting functions that lacked rendered examples in the API reference: - sc.pl.embedding: UMAP coloured by cell-type, plus a multi-panel example - sc.pl.scatter: obs-vs-obs, gene-vs-gene, and basis-driven panels - sc.pl.ranking: top-3 PC loadings, with and without the lowest values - sc.pl.paga_compare: PAGA graph next to the UMAP embedding All examples use the bundled sc.datasets.pbmc68k_reduced() so the docs build stays self-contained and deterministic. Refs scverse#1664.
bc92bca to
5de6ffa
Compare
Member
|
Wonderful, thank you so much! |
56 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds inline example plots to four
sc.pl.*functions still unchecked on the issue #1664 checklist:sc.pl.embedding— top of the list; the generic embedding plottersc.pl.scatter— daily-driver basic scatter (currently in "Misc")sc.pl.ranking— small example showing thepl.pca_loadings-style usagesc.pl.paga_compare— closes a gap in the PAGA sectionEach new Examples section uses one or more
.. plot:: :context: close-figsblocks and the bundledsc.datasets.pbmc68k_reduced()dataset, no network downloads, deterministic across CI runs. The matplotlibplot_directiveis already wired up indocs/conf.py, so no Sphinx config changes were needed.For
sc.pl.ranking, the example subsets toadata[:, adata.var["highly_variable"]]becausepbmc68k_reducedcarries PCA loadings only for the highly-variable subset (the rest areNaN); without subsetting,argsortpulls the NaNs tothe top and
set_ylimraises. Subsetting in the example also reads as a useful hint for users.I confirmed none of these functions overlap with @Ekin-Kahraman's recently-merged PRs (#4056-#4059).
Refs #1664.
Why this issue
scanpy's plotting API is the daily workhorse for single-cell exploratory analysis. Embedding example plots directly under each function's docstring closes the loop between API reference and visual output, exactly the "honest reporting + high-impact dashboard" principle I bring to data work.
Test plan
sc.pl.dotplot,sc.pl.umap, etc.)