Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Description
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:
frommatplotlib.widgetsimportCursorfrommatplotlibimportpyplotaspltfrommatplotlibimportcmfromPILimportImagefig,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 classMultiCursor
which doesn't callcanvas.draw
.
If accepted, the following lines can be removed andneedclear
will also be removed:
matplotlib/lib/matplotlib/widgets.py
Lines 2015 to 2017 inff552f4
ifself.needclear: | |
self.canvas.draw() | |
self.needclear=False |