Skip to content

Commit ae98e6b

Browse files
committed
DOC: show the matplotlib widget backend
1 parent dbbc0e5 commit ae98e6b

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

doc/code-cells.ipynb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,34 @@
419419
"fig"
420420
]
421421
},
422+
{
423+
"cell_type": "markdown",
424+
"metadata": {},
425+
"source": [
426+
"Instead of the default `inline` plotting backend,\n",
427+
"you can also use the `widget` backend\n",
428+
"(which needs the `ipympl` package to be installed):"
429+
]
430+
},
431+
{
432+
"cell_type": "code",
433+
"execution_count": null,
434+
"metadata": {},
435+
"outputs": [],
436+
"source": [
437+
"%matplotlib widget"
438+
]
439+
},
440+
{
441+
"cell_type": "code",
442+
"execution_count": null,
443+
"metadata": {},
444+
"outputs": [],
445+
"source": [
446+
"fig, ax = plt.subplots(figsize=[6, 3])\n",
447+
"ax.plot([4, 9, 7, 20, 6, 33, 13, 23, 16, 62, 8]);"
448+
]
449+
},
422450
{
423451
"cell_type": "markdown",
424452
"metadata": {},

doc/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ipykernel
22
numpy
33
matplotlib
4+
ipympl
45
pandas
56
# setuptools seems to be needed for pybtex, see
67
# https://github.com/mcmtroffaes/sphinxcontrib-bibtex/issues/345:

0 commit comments

Comments
 (0)