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 61a0cdd

Browse filesBrowse files
committed
Make EngFormatter use math font when usetex is True
1 parent 936855c commit 61a0cdd
Copy full SHA for 61a0cdd

File tree

Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed

‎lib/matplotlib/ticker.py

Copy file name to clipboardExpand all lines: lib/matplotlib/ticker.py
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,9 +1283,12 @@ def format_eng(self, num):
12831283
pow10 += 3
12841284

12851285
prefix = self.ENG_PREFIXES[int(pow10)]
1286-
1287-
formatted = "{mant:{fmt}}{sep}{prefix}".format(
1288-
mant=mant, sep=self.sep, prefix=prefix, fmt=fmt)
1286+
if rcParams['text.usetex']:
1287+
formatted = "${mant:{fmt}}${sep}{prefix}".format(
1288+
mant=mant, sep=self.sep, prefix=prefix, fmt=fmt)
1289+
else:
1290+
formatted = "{mant:{fmt}}{sep}{prefix}".format(
1291+
mant=mant, sep=self.sep, prefix=prefix, fmt=fmt)
12891292

12901293
return formatted
12911294

0 commit comments

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