Skip to content

Qt5Agg eats 100% CPU when plotting with block=True in interactive mode #10140

@Rufflewind

Description

@Rufflewind

Bug report

Bug summary

When using Qt5Agg, Matplotlib consumes a full CPU core while an interactive window is open. The cursor repeatedly shows a "spinner" when I mouse over the canvas. This didn't used to be the case.

Code for reproduction

import matplotlib.pyplot as plt
plt.plot([1, 2], [3, 4])
plt.ion()
plt.show(block=True)

Actual outcome

One of the CPU cores is pegged at 100%. Interface is very slow and barely responsive.

Expected outcome

Should not use up 100% of a CPU core when nothing is happening.

Matplotlib version

  • Operating system: Linux 4.14.8
  • Matplotlib version: 2.1.1+864.g92a93d698.dirty
  • Matplotlib backend: Qt5Agg
  • Python version: 3.6.4

This was reproduced on both XMonad and XFCE4. Affects both python-matplotlib (2.1.1) from official Arch repos and python-matplotlib-git from AUR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUI: QtRelease criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions