Skip to content

pcolormesh freezes window when zooming/panning #22253

Closed
@cycomanic

Description

@cycomanic

In matplotlib 3.5.1 on Linux (arch and opensuse) pcolormesh is causing some extreme slowdowns. When I try to zoom or pan inside the window, reactions from the mouse are very slow, such that the drawn zoom indicator is >1s delayed and the window/notebook freezes.

The extend varies somewhat by backend. Using the %matplotlib notebook backend in jupyter notebook, freezes as soon as one tries to zoom, and the kernel has to be restarted. Using Qt5Agg with ipython from the terminal, also freezes immediately. With the Gtk3Agg backend the window does not fully freeze but the zoom indicator etc. are extremely laggy.

I checked with pcolor and pcolorfast as well as imshow and all work fine.

Test case:

import matplotlib.pyplot as plt
import numpy as np
  
x = np.linspace(-5,5,512)
X,Y = np.meshgrid(x,x)
g = np.exp(-(X**2+Y**2)/2)

plt.figure()
ax = plt.subplot(111)
plt.pcolormesh(X,Y,g)
plt.show()

Run and select the zoom button in the opened window. If using Qt5Agg the window (and terminal) freezes, CTRL-C only works with very long delay.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions