Reputation: 115
Various sources (e.g. this post) make it sound like garbage collection occurs properly for figures created with matplotlib.figure.Figure()
but not for figures created with matplotlib.pyplot.figure()
. Unfortunately, I haven't been able to find documentation of this.
Is it true that Python will garbage collect old figures created with matplotlib.figure.Figure()
that are no longer used? For example...
fig = matplotlib.figure.Figure()
inside a function, will the memory for this figure be cleared up when the function ends (assuming I don't do something like return fig
)?fig = matplotlib.figure.Figure()
, will the memory for the figure immediately be cleared up if I then assign fig = 23
?Thank you!
(I apologize if this isn't actually "garbage collection." If so, let me know. 🙂)
Edit: fixed typo
Upvotes: 0
Views: 405