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

Skip to content

Commit 39f759c

Browse files
committed
fix detection of which artist(s) the mouse is over
since Artist.contains() returns a tuple it is not usable like "if my_artist.contains(): do something"
1 parent 41d9380 commit 39f759c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2891,7 +2891,7 @@ def mouse_move(self, event):
28912891
pass
28922892
else:
28932893
artists = [a for a in event.inaxes.mouseover_set
2894-
if a.contains(event) and a.get_visible()]
2894+
if a.contains(event)[0] and a.get_visible()]
28952895

28962896
if artists:
28972897
a = cbook._topmost_artist(artists)

0 commit comments

Comments
 (0)