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

Skip to content

Commit d0762c3

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 9869fd7 commit d0762c3

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
@@ -2681,7 +2681,7 @@ def mouse_move(self, event):
26812681
pass
26822682
else:
26832683
artists = [a for a in event.inaxes._mouseover_set
2684-
if a.contains(event) and a.get_visible()]
2684+
if a.contains(event)[0] and a.get_visible()]
26852685

26862686
if artists:
26872687
a = cbook._topmost_artist(artists)

0 commit comments

Comments
 (0)