Skip to content

Commit

Permalink
DOC: show the matplotlib widget backend
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed May 6, 2024
1 parent dbbc0e5 commit ae98e6b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions doc/code-cells.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,34 @@
"fig"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Instead of the default `inline` plotting backend,\n",
"you can also use the `widget` backend\n",
"(which needs the `ipympl` package to be installed):"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib widget"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fig, ax = plt.subplots(figsize=[6, 3])\n",
"ax.plot([4, 9, 7, 20, 6, 33, 13, 23, 16, 62, 8]);"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
1 change: 1 addition & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ipykernel
numpy
matplotlib
ipympl
pandas
# setuptools seems to be needed for pybtex, see
# https://github.com/mcmtroffaes/sphinxcontrib-bibtex/issues/345:
Expand Down

0 comments on commit ae98e6b

Please sign in to comment.