diff --git a/docs/examples/full-example.ipynb b/docs/examples/full-example.ipynb index d036785c..bc36b8f5 100644 --- a/docs/examples/full-example.ipynb +++ b/docs/examples/full-example.ipynb @@ -272,7 +272,7 @@ "\n", "If we make sure interactive mode is off when we create the figure then the figure will only display where we want it to.\n", "\n", - "There is ongoing work to allow usage of `ioff` as a context manager, see the [ipympl issue](https://github.com/matplotlib/ipympl/issues/220) and the [matplotlib issue](https://github.com/matplotlib/matplotlib/issues/17013)" + "To do this you can use `plt.ioff()` as a context manager." ] }, { @@ -281,9 +281,8 @@ "metadata": {}, "outputs": [], "source": [ - "plt.ioff()\n", - "fig = plt.figure()\n", - "plt.ion()\n", + "with plt.ioff():\n", + " fig = plt.figure()\n", "\n", "ax = fig.gca()\n", "ax.imshow(Z)\n", @@ -385,9 +384,8 @@ "metadata": {}, "outputs": [], "source": [ - "plt.ioff()\n", - "fig = plt.figure()\n", - "plt.ion()\n", + "with plt.ioff():\n", + " fig = plt.figure()\n", "im = plt.imshow(example_image_stack[0])\n", "\n", "def update(change):\n", @@ -425,9 +423,8 @@ "metadata": {}, "outputs": [], "source": [ - "plt.ioff()\n", - "fig = plt.figure()\n", - "plt.ion()\n", + "with plt.ioff():\n", + " fig = plt.figure()\n", "im = plt.imshow(example_image_stack[0])\n", "\n", "out = widgets.Output()\n", @@ -448,7 +445,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -462,7 +459,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.6" + "version": "3.10.8" }, "widgets": { "application/vnd.jupyter.widget-state+json": {