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
Figure cannot be closed if it has associated Agg canvas #18163
This resets the canvas of figure; this also leaves things in a state where figure.canvas is None, which then throws off the machinery for closing the figure because the currently set manager doesn't match the manager under the key 1, so it doesn't do anything. What I'm unclear on is what, if anything should be happening here.
I think what is happening is that when we set the new canvas, it does not have a manager, but we still have a manager in the global state that is disconnected from its original manager.
changed the title [-]Figure can not be closed if it has associated Agg canvas[/-][+]Figure cannot be closed if it has associated Agg canvas[/+]on Apr 10, 2023
Activity
Skip part of test_figure[_list] if Matplotlib-3.3.0 is installed
Skip part of test_figure[_list] if Matplotlib-3.3.0 is installed (#42500
dopplershift commentedon Aug 4, 2020
Well, I can reproduce. The problem is the line:
This resets the canvas of
figure; this also leaves things in a state wherefigure.canvasisNone, which then throws off the machinery for closing the figure because the currently set manager doesn't match the manager under the key1, so it doesn't do anything. What I'm unclear on is what, if anything should be happening here.QuLogic commentedon Aug 4, 2020
So the question is, why are you doing this:
and what do you expect it to do?
tacaswell commentedon Aug 5, 2020
This goes back to 7fcf123 where we changed from searching the managers we know about for the figure to asking the figure who its manager is. At the time @QuLogic raised slight concerns (https://github.com/matplotlib/matplotlib/pull/13581/files#r261907128).
I think what is happening is that when we set the new canvas, it does not have a manager, but we still have a manager in the global state that is disconnected from its original manager.
Go back to checking figures for their manager in destroy.
Go back to checking figures for their manager in destroy.
[-]Figure can not be closed if it has associated Agg canvas[/-][+]Figure cannot be closed if it has associated Agg canvas[/+]Skip part of test_figure[_list] if Matplotlib-3.3.0 is installed (pyt…