-
Notifications
You must be signed in to change notification settings - Fork 225
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
Plot is duplicated with repeated calls to plt.show() #585
Comments
You should not need to call |
It may not be needed, but it shouldn't hurt. All matplotlib gallery examples end with |
I'm not entirely what the expected behavior is. The notebook introduces a new paradigm where the same figure can be displayed multiple times as an output to different cells. In that case it seems intuitive to me that I think @timhoffm is the right person to ask about resolving what is the right thing for api consistency, do you have an opinion on the correct behavior? I'm pretty sure that the cause of this behavior is that this if manager.canvas.figure in _Backend_ipympl._to_show: ipympl/ipympl/backend_nbagg.py Lines 458 to 460 in fa3d346
Wrapping that |
My first question is on "The notebook introduces a new paradigm where the same figure can be displayed multiple times as an output to different cells." Is there documentation on this? How is that supposed to work? A simple Either way, what is the use case? If I regard a notebook as a continuous document, having the same figure twice is unneeded duplication. If I want to have an update of the figure, I can re-execute the original cell. |
Describe the issue
When I use the "%matplotlib ipympl" backend and display a plot with plt.show(), it works fine, but that plot is displayed again for every future call to plt.show(). The expected behavior is for show() to not repeat the plot output. This occurs with a fresh Anaconda (2024.10-1) installation of Python (3.12.7). This does not happen with default backend.
Versions
I believe that last error is expected for notebook>7, but I'm not certain.
The text was updated successfully, but these errors were encountered: