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

Backport PR #16948 on branch v3.2.x (solution: All subclasses of LocationEvent could be used in cbook.callbacks before being fully initialized - issue 15139)#17601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletionslib/matplotlib/backend_bases.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1420,14 +1420,17 @@ def __init__(self, name, canvas, x, y, button=None, key=None,
(*x*, *y*) in figure coords ((0, 0) = bottom left)
button pressed None, 1, 2, 3, 'up', 'down'
"""
LocationEvent.__init__(self, name, canvas, x, y, guiEvent=guiEvent)
if button in MouseButton.__members__.values():
button = MouseButton(button)
self.button = button
self.key = key
self.step = step
self.dblclick = dblclick

# super-init is deferred to the end because it calls back on
# 'axes_enter_event', which requires a fully initialized event.
LocationEvent.__init__(self, name, canvas, x, y, guiEvent=guiEvent)

def __str__(self):
return (f"{self.name}: "
f"xy=({self.x}, {self.y}) xydata=({self.xdata}, {self.ydata}) "
Expand DownExpand Up@@ -1512,8 +1515,9 @@ def on_key(event):
cid = fig.canvas.mpl_connect('key_press_event', on_key)
"""
def __init__(self, name, canvas, key, x=0, y=0, guiEvent=None):
LocationEvent.__init__(self, name, canvas, x, y, guiEvent=guiEvent)
self.key = key
# super-init deferred to the end: callback errors if called before
LocationEvent.__init__(self, name, canvas, x, y, guiEvent=guiEvent)


def _get_renderer(figure, print_method, *, draw_disabled=False):
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp