8000 Fix the artist sorting behaviour · matplotlib/matplotlib@8ea9504 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8ea9504

Browse files
committed
Fix the artist sorting behaviour
1 parent fcda62b commit 8ea9504

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import warnings
3939
import time
4040
import io
41-
from operator import itemgetter
4241

4342
import numpy as np
4443
import matplotlib.cbook as cbook
@@ -1697,7 +1696,7 @@ def onRemove(self, ev):
16971696
"""
16981697
# Find the top artist under the cursor
16991698
under = self.figure.hitlist(ev)
1700-
under.sort(key=itemgetter(0))
1699+
under.sort(key=key=lambda x: x.zorder)
17011700
h = None
17021701
if under:
17031702
h = under[-1]
@@ -2796,7 +2795,7 @@ def mouse_move(self, event):
27962795
pass
27972796
else:
27982797
artists = self.figure.hitlist(event)
2799-
artists.sort(key=itemgetter(0))
2798+
artists.sort(key=lambda x: x.zorder) 47BA
28002799
if artists:
28012800
s += artists[-1].get_zdata(event)
28022801
if len(self.mode):

0 commit comments

Comments
 (0)
0