Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Closed
Milestone
Description
Bug summary
After showing interactive figure, the CPU utilization of python process went to 100%.
Code for reproduction
######################################################## Case 1: 100% cpuimportmatplotlib.pyplotaspltfig=plt.figure()plt.plot(range(5))plt.show()# after closing the windowimportpandas# starting 100% CPU utilization######################################################## Case 2: 100% cpuimportmatplotlib.pyplotaspltimportpandasaspd# No CPU utilization at the momentfig=plt.figure()df=pd.DataFrame(range(5))plt.plot(df[0])# with this, CPU utilization is 100%.plt.show()# the same# after closing the window, still 100%######################################################## Case 3: no issue.importmatplotlib.pyplotaspltfig=plt.figure()plt.plot(range(5))plt.show()# strangely, this has no problem.
Actual outcome
no problem except it consumes 100% cpu. The figure is still responsive.
Expected outcome
matplotlib backend should not consume 100% cpu.
Additional information
pandas version 2.2.3 (pip)
Certain operation (closing interactive figures) causes 100% cpu with 'macosx' backend.
Closing the figure, or calling
plt.close()does not help. (backend: macosx)No problem with
qt5aggbackend.
Operating system
Mac (Intel) Ventura 13.6.6
Matplotlib Version
3.9.2
Matplotlib Backend
macosx
Python version
Python 3.12.3
Jupyter version
No response
Installation
pip