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

Skip to content

Commit 4dc7ff5

Browse files
author
Federico Ariza
committed
simplified max zorder
1 parent 3205e6a commit 4dc7ff5

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2884,8 +2884,7 @@ def mouse_move(self, event):
28842884
if a.contains(event) and a.get_visible()]
28852885

28862886
if artists:
2887-
2888-
a = max(enumerate(artists), key=lambda x: x[1].zorder)[1]
2887+
a = max(artists, key=lambda x: x.zorder)
28892888
if a is not event.inaxes.patch:
28902889
data = a.get_cursor_data(event)
28912890
if data is not None:

lib/matplotlib/backend_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def send_message(self, event):
339339
if a.contains(event) and a.get_visible()]
340340

341341
if artists:
342-
a = max(enumerate(artists), key=lambda x: x[1].zorder)[1]
342+
a = max(artists, key=lambda x: x.zorder)
343343
if a is not event.inaxes.patch:
344344
data = a.get_cursor_data(event)
345345
if data is not None:

0 commit comments

Comments
 (0)