-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Events break in jupyter notebook when calling clear_output() #19057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I can't get this to do anything in any version of matplotlib. The output region just say "Output()" for me no matter what version I try. Are you sure this isn't an ipython/ipywidgets/jupyter interaction problem? |
But did any of the other libraries change when you changed from 3.3.1 to 3.3.2? So far as I can tell the onClick event fires, but the I'm not saying matplotlib didn't break this, but with my jupyter (6.1.6) and ipython (7.16.1) I can't reproduce the "Expected" behaviour, regardless of Matplotlib version. |
Thanks for your efforts on this. Here are the packages in my conda environments that I'm using at the moment: The only differences are in the versions of matplotlib and matplotlib-base. My first thought was that it was a jupyter/ipython issue, but starting from matplotlib 3.3.2 I have not been able to get it to work with any version of jupyter or ipython that I tried, while starting with matplotlib 3.3.1 it's worked with all versions of jupyter and ipython that i've tried. I will try now a set up with matplotlib 3.3.1, jupyter 6.1.6 and ipython 7.16.1 to see if it works for me. I can also confirm that before the most recent update, this code was working in a range of different browsers and operating systems. |
I've tried again with the following conda packages (including matplotlib 3.3.1, jupyter 6.1.6 and ipython 7.16.1): On my system (Ubuntu 20.04.1 LTS, firefox 83.0 (64-bit)), it works as expected in that clicking the plot updates the text. |
Looks like #18638, which would be fixed in 3.3.3. Please try the latest version. |
Yes - installing 3.3.3 from conda-forge fixed the problem. Thanks. |
Bug report
Bug summary
As of matplotlib version 3.3.2, calling IPython.display.clear_output() in a jupyter notebook seems to break the matplotlib figure event handler system. It seems to be a problem with the interaction between the jupyter notebook widget display system and the matplotlib event system, but reverting to matplotlib 3.3.1 corrects the issue.
Code for reproduction
In a jupyter notebook:
Actual outcome
Clicking on the plot once updates the text in the Output widget, further clicks do nothing.
Further events result in error messages from the jupyter server:
Expected outcome
Each time you click on the plot the text in the Output widget should be updated with details of the event.
This code works in version 3.3.1, but not in 3.3.2.
print(matplotlib.get_backend())
): nbAggconda
default channel
The text was updated successfully, but these errors were encountered: