Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3205e6a

Browse filesBrowse files
author
Federico Ariza
committed
Adding the artist data on mouse move event message
1 parent acdf412 commit 3205e6a
Copy full SHA for 3205e6a

File tree

Expand file treeCollapse file tree

2 files changed

+11
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-1
lines changed

‎lib/matplotlib/backend_bases.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_bases.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2881,7 +2881,7 @@ def mouse_move(self, event):
28812881
pass
28822882
else:
28832883
artists = [a for a in event.inaxes.mouseover_set
2884-
if a.contains(event)]
2884+
if a.contains(event) and a.get_visible()]
28852885

28862886
if artists:
28872887

‎lib/matplotlib/backend_tools.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_tools.py
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,16 @@ def send_message(self, event):
335335
except (ValueError, OverflowError):
336336
pass
337337
else:
338+
artists = [a for a in event.inaxes.mouseover_set
339+
if a.contains(event) and a.get_visible()]
340+
341+
if artists:
342+
a = max(enumerate(artists), key=lambda x: x[1].zorder)[1]
343+
if a is not event.inaxes.patch:
344+
data = a.get_cursor_data(event)
345+
if data is not None:
346+
s += ' [%s]' % a.format_cursor_data(data)
347+
338348
message = s
339349
self.toolmanager.message_event(message, self)
340350

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.