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

Skip to content

Commit 1857fca

Browse files
committed
Move image value to second line; remove mode info.
1 parent c7f5923 commit 1857fca

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2881,23 +2881,18 @@ def mouse_move(self, event):
28812881
except (ValueError, OverflowError):
28822882
pass
28832883
else:
2884+
s = s.rstrip()
28842885
artists = [a for a in event.inaxes._mouseover_set
28852886
if a.contains(event)[0] and a.get_visible()]
2886-
28872887
if artists:
28882888
a = cbook._topmost_artist(artists)
28892889
if a is not event.inaxes.patch:
28902890
data = a.get_cursor_data(event)
28912891
if data is not None:
2892-
data_str = a.format_cursor_data(data)
2893-
if data_str is not None:
2894-
s = s + ' ' + data_str
2895-
2896-
s = s.rstrip()
2897-
if len(self.mode):
2898-
self.set_message('%s, %s' % (self.mode, s))
2899-
else:
2900-
self.set_message(s)
2892+
data_str = a.format_cursor_data(data).rstrip()
2893+
if data_str:
2894+
s = s + '\n' + data_str
2895+
self.set_message(s)
29012896
else:
29022897
self.set_message(self.mode)
29032898

0 commit comments

Comments
 (0)