We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1dfa06 commit 0b5185bCopy full SHA for 0b5185b
lib/matplotlib/artist.py
@@ -348,7 +348,17 @@ def pick(self, mouseevent):
348
349
# Pick children
350
for a in self.get_children():
351
- a.pick(mouseevent)
+ # make sure the event happened in the same axes
352
+ ax = getattr(a, 'axes', None)
353
+ if mouseevent.inaxes is None or ax is None or \
354
+ mouseevent.inaxes == ax:
355
+ # we need to check if mouseevent.inaxes is None
356
+ # because some objects associated with an axes (e.g., a
357
+ # tick label) can be outside the bounding box of the
358
+ # axes and inaxes will be None
359
+ # also check that ax is None so that it traverse objects
360
+ # which do no have an axes property but children might
361
+ a.pick(mouseevent)
362
363
def set_picker(self, picker):
364
"""
0 commit comments