Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[MNT]: Draggable legend gets stuck on cursor after scroll event #29142

Closed
@p479h

Description

@p479h

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp