Skip to content

Commit

Permalink
PRF: minor performance tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tacaswell committed Jul 28, 2015
1 parent 2d0cc7d commit a4557c2
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2813,15 +2813,14 @@ def mouse_move(self, event):
pass
else:
artists = event.inaxes.hitlist(event)
if event.inaxes.patch in artists:
artists.remove(event.inaxes.patch)

if artists:
artists.sort(key=lambda x: x.zorder)
a = artists[-1]
data = a.get_cursor_data(event)
if data is not None:
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)

if len(self.mode):
self.set_message('%s, %s' % (self.mode, s))
else:
Expand Down

0 comments on commit a4557c2

Please sign in to comment.