Skip to content

Commit eec6c99

Browse files
committed
Improved version based on gh comment
1 parent 9221a55 commit eec6c99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/ticker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,6 +1230,7 @@ def __init__(self, unit="", places=None, sep=" "):
12301230
self.unit = unit
12311231
self.places = places
12321232
self.sep = sep
1233+
self._usetex = rcParams['text.usetex']
12331234

12341235
def __call__(self, x, pos=None):
12351236
s = "%s%s" % (self.format_eng(x), self.unit)
@@ -1281,7 +1282,7 @@ def format_eng(self, num):
12811282
pow10 += 3
12821283

12831284
prefix = self.ENG_PREFIXES[int(pow10)]
1284-
if rcParams['text.usetex']:
1285+
if self._usetex:
12851286
formatted = "${mant:{fmt}}${sep}{prefix}".format(
12861287
mant=mant, sep=self.sep, prefix=prefix, fmt=fmt)
12871288
else:

0 commit comments

Comments
 (0)