From ae98e6ba38b6f79aa7d2c3ab7d5366dfead05be4 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Sun, 5 May 2024 17:37:37 +0200 Subject: [PATCH] DOC: show the matplotlib widget backend --- doc/code-cells.ipynb | 28 ++++++++++++++++++++++++++++ doc/requirements.txt | 1 + 2 files changed, 29 insertions(+) diff --git a/doc/code-cells.ipynb b/doc/code-cells.ipynb index 099a9efa..0795fe26 100644 --- a/doc/code-cells.ipynb +++ b/doc/code-cells.ipynb @@ -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": {}, diff --git a/doc/requirements.txt b/doc/requirements.txt index 07489bbe..3c83291b 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -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: