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

Revert "Add inaxes method to FigureCanvas to check whether point is in an axes."#13404

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

Closed
jklymak wants to merge1 commit intomasterfromrevert-9845-inaxes
Closed
Show file tree
Hide file tree
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
View file
Open in desktop

This file was deleted.

42 changes: 6 additions & 36 deletionslib/matplotlib/backend_bases.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1319,12 +1319,15 @@ def __init__(self, name, canvas, x, y, guiEvent=None):
self._update_enter_leave()
return

# Find all axes containing the mouse
if self.canvas.mouse_grabber is None:
self.inaxes = self.canvas.inaxes((x, y))
axes_list = [a for a in self.canvas.figure.get_axes()
if a.in_axes(self)]
else:
self.inaxes = self.canvas.mouse_grabber
axes_list =[self.canvas.mouse_grabber]

if self.inaxes is not None:
if axes_list:
self.inaxes = cbook._topmost_artist(axes_list)
try:
trans = self.inaxes.transData.inverted()
xdata, ydata = trans.transform_point((x, y))
Expand DownExpand Up@@ -1789,39 +1792,6 @@ def enter_notify_event(self, guiEvent=None, xy=None):
event = LocationEvent('figure_enter_event', self, x, y, guiEvent)
self.callbacks.process('figure_enter_event', event)

@cbook.deprecated("2.1")
def idle_event(self, guiEvent=None):
"""Called when GUI is idle."""
s = 'idle_event'
event = IdleEvent(s, self, guiEvent=guiEvent)
self.callbacks.process(s, event)

def inaxes(self, xy):
"""
Check if a point is in an axes.

Parameters
----------
xy : tuple or list
(x,y) coordinates.
x position - pixels from left of canvas.
y position - pixels from bottom of canvas.

Returns
-------
axes: topmost axes containing the point, or None if no axes.

"""
axes_list = [a for a in self.figure.get_axes()
if a.patch.contains_point(xy)]

if axes_list:
axes = cbook._topmost_artist(axes_list)
else:
axes = None

return axes

def grab_mouse(self, ax):
"""
Set the child axes which are currently grabbing the mouse events.
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp