Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6ab156f

Browse files
committed
Merge pull request #2756 from cimarronm/remove_picker_limitation
Removes artificial limit in artist picker traversal. There are quite a
2 parents 5079b6d + 0b5185b commit 6ab156f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/matplotlib/artist.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,14 @@ def pick(self, mouseevent):
350350
for a in self.get_children():
351351
# make sure the event happened in the same axes
352352
ax = getattr(a, 'axes', None)
353-
if mouseevent.inaxes is None or mouseevent.inaxes == ax:
353+
if mouseevent.inaxes is None or ax is None or \
354+
mouseevent.inaxes == ax:
354355
# we need to check if mouseevent.inaxes is None
355356
# because some objects associated with an axes (e.g., a
356357
# tick label) can be outside the bounding box of the
357358
# 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
358361
a.pick(mouseevent)
359362

360363
def set_picker(self, picker):

0 commit comments

Comments
 (0)