Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Description
Summary
Draggable legend gets stuck to cursor after scrolling while hovering the artist. To 'unstick' it, it is necessary to left click. I believe the expected behavior is to only drag the legend while holding the left mouse button. If that is not the case, please close this issue.
Proposed fix
Sample code:
importmatplotlib.pyplotaspltplt.plot([],[],label='scroll over me, then move the cursor')plt.legend(draggable=True)plt.show()
I believe the issue is that the classDraggableBase
(at line 1425 of matplotlib/offsetbox.py) uses a 'pick' event to grab the artist, which I believe includes scrolling events. It might be possible to return from a false positive pick by checking that the pick event is a mouse click instead of scrolling atDraggableBase.on_pick
. Another alternative is to change the pick event to abutton_press
event.