10BC0 support picking of axes objects outside their bounding box · matplotlib/matplotlib@3509b3b · GitHub
[go: up one dir, main page]

Skip to content

Commit 3509b3b

Browse files
committed
support picking of axes objects outside their bounding box
svn path=/trunk/matplotlib/; revision=8106
1 parent 9275214 commit 3509b3b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/artist.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,11 @@ def pick(self, mouseevent):
320320
for a in self.get_children():
321321
# make sure the event happened in the same axes
322322
ax = getattr(a, 'axes', None)
323-
if mouseevent.inaxes==ax:
323+
if mouseevent.inaxes is None or mouseevent.inaxes==ax:
324+
# we need to check if mouseevent.inaxes is None
325+
# because some objects associated with an axes (eg a
326+
# tick label) can be outside the bounding box of the
327+
# axes and inaxes will be None
324328
a.pick(mouseevent)
325329

326330
def set_picker(self, picker):

0 commit comments

Comments
 (0)
0