Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Bug]: High CPU utilization of the macosx backend #28960

Copy link
Copy link
Closed
@cinsk

Description

@cinsk
Issue body actions

Bug summary

After showing interactive figure, the CPU utilization of python process went to 100%.

Code for reproduction

#######################################################
# Case 1: 100% cpu
import matplotlib.pyplot as plt
fig = plt.figure()
plt.plot(range(5))
plt.show()
# after closing the window
import pandas              # starting 100% CPU utilization

#######################################################
# Case 2: 100% cpu
import matplotlib.pyplot as plt
import pandas as pd

# No CPU utilization at the moment

fig = 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.
import matplotlib.pyplot as plt
fig = 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 qt5agg backend.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.