Skip to content

Commit

Permalink
update ioff usage in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhi committed Feb 8, 2023
1 parent dcae90f commit d27ea74
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions docs/examples/full-example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
]
},
{
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -448,7 +445,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -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": {
Expand Down

0 comments on commit d27ea74

Please sign in to comment.