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

Skip to content

Commit a6e81ca

Browse files
committed
Move image value to second line; remove mode info.
1 parent e82fc97 commit a6e81ca

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
@@ -2835,23 +2835,18 @@ def mouse_move(self, event):
28352835
except (ValueError, OverflowError):
28362836
pass
28372837
else:
2838+
s = s.rstrip()
28382839
artists = [a for a in event.inaxes._mouseover_set
28392840
if a.contains(event)[0] and a.get_visible()]
2840-
28412841
if artists:
28422842
a = cbook._topmost_artist(artists)
28432843
if a is not event.inaxes.patch:
28442844
data = a.get_cursor_data(event)
28452845
if data is not None:
2846-
data_str = a.format_cursor_data(data)
2847-
if data_str is not None:
2848-
s = s + ' ' + data_str
2849-
2850-
s = s.rstrip()
2851-
if len(self.mode):
2852-
self.set_message('%s, %s' % (self.mode, s))
2853-
else:
2854-
self.set_message(s)
2846+
data_str = a.format_cursor_data(data).rstrip()
2847+
if data_str:
2848+
s = s + '\n' + data_str
2849+
self.set_message(s)
28552850
else:
28562851
self.set_message(self.mode)
28572852

0 commit comments

Comments
 (0)