Skip to content

Commit e67ca17

Browse files
Add more information on how to save plots (#177)
Co-authored-by: Phil Schaf <[email protected]>
1 parent f776746 commit e67ca17

File tree

7 files changed

+544
-128
lines changed

7 files changed

+544
-128
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
/figures/
1111
/scripts/
1212

13+
# example files
14+
CD79A.png
15+
1316
# caches
1417
*~
1518
__pycache__/

basic-scrna-tutorial.ipynb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,19 @@
640640
"sc.pl.umap(adata, color=[\"leiden\"])"
641641
]
642642
},
643+
{
644+
"cell_type": "markdown",
645+
"id": "90e510c8",
646+
"metadata": {},
647+
"source": [
648+
"```{dropdown} How do I save a plot?\n",
649+
"You can save a plot by directly accessing the returned Matplotlib figure:\n",
650+
"````python\n",
651+
"sc.pl.umap(adata, color=[\"leiden\"], show).figure.savefig(\"output_path.ext\")\n",
652+
"````\n",
653+
"```"
654+
]
655+
},
643656
{
644657
"cell_type": "markdown",
645658
"id": "7d7410a1-333a-4f21-b53e-91af768b07c7",

conf.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@
2828
copyright = f"{datetime.now(UTC):%Y}, {author}" # noqa: A001
2929
release = version = meta["Version"]
3030

31-
extensions = [
32-
"myst_nb",
33-
"sphinx.ext.intersphinx",
34-
]
31+
extensions = ["myst_nb", "sphinx.ext.intersphinx", "sphinx_design"]
3532
myst_enable_extensions = [
3633
"colon_fence",
3734
]

paga-paul15.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@
862862
},
863863
{
864864
"cell_type": "code",
865-
"execution_count": 28,
865+
"execution_count": null,
866866
"metadata": {},
867867
"outputs": [
868868
{
@@ -911,7 +911,6 @@
911911
" fontsize=12,\n",
912912
" frameon=False,\n",
913913
" edges=True,\n",
914-
" save=True,\n",
915914
")"
916915
]
917916
},

pbmc3k.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,7 +2257,7 @@
22572257
},
22582258
{
22592259
"cell_type": "code",
2260-
"execution_count": 47,
2260+
"execution_count": null,
22612261
"metadata": {},
22622262
"outputs": [
22632263
{
@@ -2284,7 +2284,7 @@
22842284
}
22852285
],
22862286
"source": [
2287-
"sc.pl.umap(adata, color=\"leiden\", legend_loc=\"on data\", title=\"\", frameon=False, save=\".pdf\")"
2287+
"sc.pl.umap(adata, color=\"leiden\", legend_loc=\"on data\", title=\"\", frameon=False)"
22882288
]
22892289
},
22902290
{

plotting/core.ipynb

Lines changed: 523 additions & 120 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ dependencies = [
2222
"myst-nb",
2323
"scanpydoc[theme]>=0.13.4",
2424
"sphinx",
25+
"sphinx-design",
2526
]
2627

2728
[tool.hatch.version]

0 commit comments

Comments
 (0)