8000 Fix default pixel data and handle no pixel data · matplotlib/matplotlib@1429206 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1429206

Browse files
committed
Fix default pixel data and handle no pixel data
1 parent ea565c6 commit 1429206

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/matplotlib/artist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ def get_pixel_data(self, event):
907907
"""
908908
Get the pixel data for a given event.
909909
"""
910-
return ''
910+
return None
911911

912912
def format_pixel_data(self, data):
913913
"""

lib/matplotlib/backend_bases.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2800,8 +2800,9 @@ def mouse_move(self, event):
28002800
artists.sort(key=lambda x: x.zorder)
28012801
if artists:
28022802
a = artists[-1]
2803-
data = a.get_cursor_data(event)
2804-
s += 'data= %s' % a.format_cursor_data(data)
2803+
data = a.get_pixel_data(event)
2804+
if data is not None:
2805+
s += ' data=%s' % a.format_pixel_data(data)
28052806
if len(self.mode):
28062807
self.set_message('%s, %s' % (self.mode, s))
28072808
else:

0 commit comments

Comments
 (0)
0