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 5e52ce1

Browse filesBrowse files
authored
Merge pull request #10878 from ocastany/master
Change hardcoded brackets for Toolbar message
2 parents a4139ae + 9ecc264 commit 5e52ce1
Copy full SHA for 5e52ce1

File tree

Expand file treeCollapse file tree

3 files changed

+9
-4
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+9
-4
lines changed

‎lib/matplotlib/artist.py

Copy file name to clipboardExpand all lines: lib/matplotlib/artist.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,8 +1042,9 @@ def format_cursor_data(self, data):
10421042
data[0]
10431043
except (TypeError, IndexError):
10441044
data = [data]
1045-
return ', '.join('{:0.3g}'.format(item) for item in data if
1046-
isinstance(item, (np.floating, np.integer, int, float)))
1045+
data_str = ', '.join('{:0.3g}'.format(item) for item in data if
1046+
isinstance(item, (np.floating, np.integer, int, float)))
1047+
return "[" + data_str + "]"
10471048

10481049
@property
10491050
def mouseover(self):

‎lib/matplotlib/backend_bases.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_bases.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2860,7 +2860,9 @@ def mouse_move(self, event):
28602860
if a is not event.inaxes.patch:
28612861
data = a.get_cursor_data(event)
28622862
if data is not None:
2863-
s += ' [%s]' % a.format_cursor_data(data)
2863+
data_str = a.format_cursor_data(data)
2864+
if data_str is not None:
2865+
s = s + ' ' + data_str
28642866

28652867
if len(self.mode):
28662868
self.set_message('%s, %s' % (self.mode, s))

‎lib/matplotlib/backend_tools.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_tools.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,9 @@ def send_message(self, event):
344344
if a is not event.inaxes.patch:
345345
data = a.get_cursor_data(event)
346346
if data is not None:
347-
s += ' [%s]' % a.format_cursor_data(data)
347+
data_str = a.format_cursor_data(data)
348+
if data_str is not None:
349+
s = s + ' ' + data_str
348350

349351
message = s
350352
self.toolmanager.message_event(message, self)

0 commit comments

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