Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update ioff usage in docs #515

Merged
merged 2 commits into from
Feb 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 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 All @@ -301,7 +300,7 @@
"source": [
"# Interacting with other widgets\n",
"\n",
"## Changing a line plot with a slide"
"## Changing a line plot with a slider"
]
},
{
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.11.0"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down