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

Appearance settings

Commit a4557c2

Browse filesBrowse files
committed
PRF: minor performance tweaks
1 parent 2d0cc7d commit a4557c2
Copy full SHA for a4557c2

File tree

Expand file treeCollapse file tree

1 file changed

+6
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-7
lines changed

‎lib/matplotlib/backend_bases.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_bases.py
+6-7Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2813,15 +2813,14 @@ def mouse_move(self, event):
28132813
pass
28142814
else:
28152815
artists = event.inaxes.hitlist(event)
2816-
if event.inaxes.patch in artists:
2817-
artists.remove(event.inaxes.patch)
28182816

28192817
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)
2818+
a = max(enumerate(artists), key=lambda x: x[1].zorder)[1]
2819+
if a is not event.inaxes.patch:
2820+
data = a.get_cursor_data(event)
2821+
if data is not None:
2822+
s += ' [%s]' % a.format_cursor_data(data)
2823+
28252824
if len(self.mode):
28262825
self.set_message('%s, %s' % (self.mode, s))
28272826
else:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.