Thanks to visit codestin.com Credit goes to github.com
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 2d0cc7d commit a4557c2Copy full SHA for a4557c2
1 file changed
lib/matplotlib/backend_bases.py
@@ -2813,15 +2813,14 @@ def mouse_move(self, event):
2813
pass
2814
else:
2815
artists = event.inaxes.hitlist(event)
2816
- if event.inaxes.patch in artists:
2817
- artists.remove(event.inaxes.patch)
2818
2819
if artists:
2820
- artists.sort(key=lambda x: x.zorder)
2821
- a = artists[-1]
2822
- data = a.get_cursor_data(event)
2823
- if data is not None:
2824
- s += ' [%s]' % a.format_cursor_data(data)
+ a = max(enumerate(artists), key=lambda x: x[1].zorder)[1]
+ if a is not event.inaxes.patch:
+ data = a.get_cursor_data(event)
+ if data is not None:
+ s += ' [%s]' % a.format_cursor_data(data)
+
2825
if len(self.mode):
2826
self.set_message('%s, %s' % (self.mode, s))
2827
0 commit comments