Problem
A busy icon appears every time the mouse goes off the axes and the cursor is cleared.
For image files ~100MB, the busy icon lasts 1-2 seconds each time.
Sample code:
from matplotlib.widgets import Cursor
from matplotlib import pyplot as plt
from matplotlib import cm
from PIL import Image
fig, ax = plt.subplots()
img = Image.open(r"Path to large image file ~100MB")
ax.imshow(img, cmap=cm.gray)
cursor = Cursor(ax, useblit=True, color='red', linewidth=1)
plt.show()
Proposed solution
I think the behavior of not clearing the cursor when the mouse goes off the axes is acceptable.
It is also consistent with the behavior of the similar class MultiCursor which doesn't call canvas.draw.
If accepted, the following lines can be removed and needclear will also be removed:
|
if self.needclear: |
|
self.canvas.draw() |
|
self.needclear = False |
Problem
A busy icon appears every time the mouse goes off the axes and the cursor is cleared.
For image files ~100MB, the busy icon lasts 1-2 seconds each time.
Sample code:
Proposed solution
I think the behavior of not clearing the cursor when the mouse goes off the axes is acceptable.
It is also consistent with the behavior of the similar class
MultiCursorwhich doesn't callcanvas.draw.If accepted, the following lines can be removed and
needclearwill also be removed:matplotlib/lib/matplotlib/widgets.py
Lines 2015 to 2017 in ff552f4