"%matplotlib widget" (ipywidget) only works (in Interactive Window) after manually clicking Clear All or Restart Kernel #17013
Unanswered
DanCodigaTT
asked this question in
Questions and Answers
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to be able to select (in an editor window) the first part of a python script which makes calls to matplotlib, use shift-enter, and have the new Interactive Window open to show the resulting plot in the ipywidget where I can interact with it.
This seems like a basic expected functionality consistent with the way the Interactive Window and the IPython magic "%matplotlib widget" are designed to work.
What happens for me now is that the Interactive Window opens and the code runs, but ... the ipywidget does not open nor does the plot image get shown at all.
But ... if I then manually click Clear All or Restart Kernel, then select the same code and use shift-enter, the code is run again and this time the ipywidget displays the resulting plot, and functions just the way I want.
Any suggestions to avoid this apparent requirement for me to execute Clear All or Restart Kernel in a fresh Interactive Window, before I can get ipywidget (%matplotlib widget) interactive plotting to function?
(As a workaround, I tried adding "%reset -f" to jupyter.runStartupCommands in my settings file. But I could not get that to work.)
Details of my configuration:
...
"interactiveWindow.collapseCellInputCode": "never",
"jupyter.interactiveWindow.creationMode": "single",
"jupyter.interactiveWindow.textEditor.executeSelection": true,
"jupyter.askForKernelRestart": false,
"jupyter.widgetScriptSources": [
"jsdelivr.com",
"unpkg.com"
],
"jupyter.runStartupCommands": [
"%matplotlib widget",
"%load_ext autoreload",
"%autoreload 3",
],
...
Beta Was this translation helpful? Give feedback.
All reactions