You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
raw.plot(block=True) freezes the jupyter kernel forever #6528
When plotting continuous "raw" data and specify block=True, everything works well until you try to close the figure. Control is never handed back to the command line. This does not occur when using command line ipython, but does occur when using Spyder or a Jupyter notebook.
I was able to fix this for myself by disabling "Active support" for Matplotlib (under tools -> preferences -> IPython console -> Graphics), then manually setting the Matplotlib backend via:
import matplotlib
matplotlib.use('Qt5Agg')
or: %matplotlib qt5, but Spyder complained about this version.
I cannot reproduce the issue, the minimal example does not block execution in both a regular Jupyter notebook and inside VS Code. Maybe you do not have the latest versions of the involved packages (i.e. Matplotlib, Jupyter)?
However, @mvonflotow's suggestion of disabling Spyder's active support did the trick. I'm guessing there's some weird interaction between the Qt thread spawned by the QtConsole component that Spyder uses and the block=True behavior. I'll file the issue there.
Activity
agramfort commentedon Jul 4, 2019
Kriattiffer commentedon Jul 8, 2019
You may need to switch backedns with
%matplotlib qtor
%matplotlib tkwhen you need interactive plot
wmvanvliet commentedon Jul 9, 2019
Yup, this is a jupyter/matplotlib issue. This also fails with the same behaviour on my end:
agramfort commentedon Nov 19, 2019
@wmvanvliet @SophieHerbst just reported the same problem. Did you end up solving this pb?
wmvanvliet commentedon Nov 19, 2019
Unfortunately, no.
mvonflotow commentedon Aug 3, 2021
I was able to fix this for myself by disabling "Active support" for Matplotlib (under tools -> preferences -> IPython console -> Graphics), then manually setting the Matplotlib backend via:
import matplotlib
matplotlib.use('Qt5Agg')
or: %matplotlib qt5, but Spyder complained about this version.
Let me know if this works for you @wmvanvliet
CarinaFo commentedon Aug 31, 2021
Did anyone solve this issue for jupyter notebook? I am using matplotlib.qt and I get the mentioned kernel freeze.
aroyphillips commentedon Oct 12, 2022
I would like to reopen this issue as well for jupyter notebook. Is there a solution?
cbrnr commentedon Oct 12, 2022
I cannot reproduce the issue, the minimal example does not block execution in both a regular Jupyter notebook and inside VS Code. Maybe you do not have the latest versions of the involved packages (i.e. Matplotlib, Jupyter)?
wmvanvliet commentedon Oct 12, 2022
This still breaks for me in Spyder, but not in plain
ipythonor in a notebook:However, @mvonflotow's suggestion of disabling Spyder's active support did the trick. I'm guessing there's some weird interaction between the Qt thread spawned by the
QtConsolecomponent that Spyder uses and theblock=Truebehavior. I'll file the issue there.