Description
Bug summary
When I create pcolormesh plot with big enough data, lasso selector (useblit=True) is redrawing very slowly. Don't have problem with this in version 3.4.2
Code for reproduction
import numpy as np
from matplotlib.widgets import LassoSelector
import matplotlib.pyplot as plt
class SelectFromCollection:
def __init__(self, ax):
self.lasso = LassoSelector(ax, onselect=self.onselect, useblit=True)
def onselect(self, verts):
pass
if __name__ == '__main__':
fig, ax = plt.subplots()
np.random.seed(19680801)
Z = np.random.rand(1095, 100)
x = np.arange(-0.5, 100, 1) # len = 11
y = np.arange(4.5, 1100, 1) # len = 7
ax.pcolormesh(x, y, Z)
# data2d = np.random.randint(0, 100,(1000,1000))
# ax.imshow(data2d)
selector = SelectFromCollection(ax)
plt.show()
Actual outcome
Slow lasso drawing
Expected outcome
Quick lasso drawing :)
Additional information
If imshow is used, lasso selector is acting normaly.
Operating system
Ubuntu 20.04
Matplotlib Version
3.5.1
Matplotlib Backend
QtAgg
Python version
3.8
Jupyter version
No response
Installation
No response