Skip to content

Commit a0755e1

Browse files
committed
Update code to work with newer Jupyter versions
1 parent acd2ea2 commit a0755e1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

chapter03_notebook/03_widgets.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,10 @@
345345
"source": [
346346
"@button.on_click\n",
347347
"def plot_on_click(b):\n",
348-
" plot2()"
348+
" out.clear_output(wait=True)\n",
349+
" with out:\n",
350+
" plot2()\n",
351+
" plt.show()"
349352
]
350353
},
351354
{
@@ -385,10 +388,11 @@
385388
}
386389
],
387390
"source": [
391+
"out = widgets.Output()\n",
388392
"tab = widgets.Tab(children=[tab1, tab2])\n",
389393
"tab.set_title(0, 'plot')\n",
390394
"tab.set_title(1, 'styling')\n",
391-
"VBox(children=[tab, button])"
395+
"VBox(children=[tab, button, out])"
392396
]
393397
}
394398
],

0 commit comments

Comments
 (0)