Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Labels
Milestone
Description
Bug summary
When usingmatplotlib.colorbar.make_axes
function,plt.close()
does not clear the new colorbar axes from memory. Tested for the Qt5 backend only. Maybe related to#22002, at least in the sense that I see no leak for Qt5 when no colorbar axes are added.
Code for reproduction
%pylabqt5frommatplotlibimportcolorbarimportpsutilimportgcp=psutil.Process()foriinrange(5):fig,ax=plt.subplots(1,1)ax.imshow(random.normal(size=(100,100)))cax=colorbar.make_axes(ax)plt.savefig("test.png")plt.pause(0.1)plt.close(fig)delfigdelaxdelcaxgc.collect()print(p.memory_full_info().uss/1e6)
Actual outcome
250.744832
255.209472
259.514368
264.13056
268.099584
Expected outcome
Constant memory usage, as is when the line cax = colorbar.make_axes(ax)
is commented out.
Additional information
No response
Operating system
Windows
Matplotlib Version
3.4.2
Matplotlib Backend
Qt5Agg (PyQt)
Python version
3.7.6
Jupyter version
No response
Installation
from source (.tar.gz)