-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Old matplotlib ipympl figures not getting released at cell refresh #5373
Comments
|
%matplotlib notebook
from matplotlib import pyplot as plt
fig = plt.figure() gives an error for me in JupyterLab. |
(it sounds like the error you are mentioning is a kernel error, which would mean it has nothing to do with JupyterLab and has to do with matplotlib or whoever is providing the rendering backend for matplotlib.) |
Oh I'm sorry, I typed notebook from old muscle memory, I meant |
And this is the warning RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface ( |
Thanks, that makes more sense. This is a warning from ipympl. The discussion about it is over at matplotlib/ipympl#4. It looks like the discussion there has stalled - perhaps you'd like to start it up again, or at least post your workaround? |
(Closing here so we can move the discussion over to matplotlib/ipympl#4) |
If I create a figure like
fig = plt.figure()
using
%matplotlib notebook
and execute the cell 20 times, I get a warning that twenty figures have been opened. Obviously the old figures hang around in the background, even though there is no reference to them anymore. This can get quite memory demanding if the figures have a lot of content and I iteratively refine them.
I've been using a workaround with
But this is pretty annoying if there are many cells like that. Is this a matplotlib problem because of their caching in the background or a jupyter lab problem because it doesn't release?
Thanks for any input :)
The text was updated successfully, but these errors were encountered: