Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1e6d8b1

Browse files
authored
Merge pull request #2 from guoci/PR_ipywidgets
Update code to work with newer Jupyter versions
2 parents acd2ea2 + a0755e1 commit 1e6d8b1

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)

AltStyle によって変換されたページ (->オリジナル) /