Skip to content

Commit bc39d8f

Browse files
committed
Update "docs"
1 parent 783419b commit bc39d8f

File tree

1 file changed

+3
-40
lines changed

1 file changed

+3
-40
lines changed

examples/ipympl.ipynb

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
"source": [
202202
"# Interactions with other widgets and layouting\n",
203203
"\n",
204-
"When you want to embed the figure into a layout of other widgets you should call `plt.ioff()` before creating the figure otherwise code inside of `plt.figure()` will display the canvas automatically and outside of your layout. "
204+
"When you want to embed the figure into a layout of other widgets you should call `plt.ioff()` before creating the figure otherwise `plt.figure()` will trigger a display of the canvas automatically and outside of your layout. "
205205
]
206206
},
207207
{
@@ -225,7 +225,6 @@
225225
"# this is default but if this notebook is executed out of order it may have been turned off\n",
226226
"plt.ion()\n",
227227
"\n",
228-
"\n",
229228
"fig = plt.figure()\n",
230229
"ax = fig.gca()\n",
231230
"ax.imshow(Z)\n",
@@ -268,35 +267,6 @@
268267
")"
269268
]
270269
},
271-
{
272-
"cell_type": "markdown",
273-
"metadata": {},
274-
"source": [
275-
"### Fixing the double display with `ipywidgets.Output`\n",
276-
"\n",
277-
"Using `plt.ioff` use matplotlib to avoid the double display of the plot. You can also use `ipywidgets.Output` to capture the plot display to prevent this"
278-
]
279-
},
280-
{
281-
"cell_type": "code",
282-
"execution_count": null,
283-
"metadata": {},
284-
"outputs": [],
285-
"source": [
286-
"out = widgets.Output()\n",
287-
"with out:\n",
288-
" fig = plt.figure()\n",
289-
"\n",
290-
"ax = fig.gca()\n",
291-
"ax.imshow(Z)\n",
292-
"\n",
293-
"widgets.AppLayout(\n",
294-
" center=out,\n",
295-
" footer=widgets.Button(icon='check'),\n",
296-
" pane_heights=[0, 6, 1]\n",
297-
")"
298-
]
299-
},
300270
{
301271
"cell_type": "markdown",
302272
"metadata": {},
@@ -446,18 +416,11 @@
446416
"display(widgets.VBox([slider, fig.canvas]))\n",
447417
"display(out)"
448418
]
449-
},
450-
{
451-
"cell_type": "code",
452-
"execution_count": null,
453-
"metadata": {},
454-
"outputs": [],
455-
"source": []
456419
}
457420
],
458421
"metadata": {
459422
"kernelspec": {
460-
"display_name": "Python 3",
423+
"display_name": "Python 3 (ipykernel)",
461424
"language": "python",
462425
"name": "python3"
463426
},
@@ -471,7 +434,7 @@
471434
"name": "python",
472435
"nbconvert_exporter": "python",
473436
"pygments_lexer": "ipython3",
474-
"version": "3.7.8"
437+
"version": "3.9.7"
475438
},
476439
"widgets": {
477440
"application/vnd.jupyter.widget-state+json": {

0 commit comments

Comments
 (0)