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 3b37b08

Browse filesBrowse files
committed
Handle \times in strip_math to better handle LogFormatter.
1 parent bd4b764 commit 3b37b08
Copy full SHA for 3b37b08

File tree

1 file changed

+12
-4
lines changed
Filter options

1 file changed

+12
-4
lines changed

‎lib/matplotlib/cbook/__init__.py

Copy file name to clipboardExpand all lines: lib/matplotlib/cbook/__init__.py
+12-4Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,18 @@ def strip_math(s):
309309
"""
310310
if len(s) >= 2 and s[0] == s[-1] == "$":
311311
s = s[1:-1]
312-
remove = [
313-
r'\mathdefault', r'\rm', r'\cal', r'\tt', r'\it', '\\', '{', '}']
314-
for r in remove:
315-
s = s.replace(r, '')
312+
for tex, plain in [
313+
(r"\times", "x"), # Specifically for Formatter support.
314+
(r"\mathdefault", ""),
315+
(r"\rm", ""),
316+
(r"\cal", ""),
317+
(r"\tt", ""),
318+
(r"\it", ""),
319+
("\\", ""),
320+
("{", ""),
321+
("}", ""),
322+
]:
323+
s = s.replace(tex, plain)
316324
return s
317325

318326

0 commit comments

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