Skip to content
Merged
Prev Previous commit
Next Next commit
API: cache usetex value at text creation time
  • Loading branch information
tacaswell committed Dec 12, 2016
commit 2ddcc68c7de0cfef089e5b09bcad0c4a3d04afab
4 changes: 2 additions & 2 deletions lib/matplotlib/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ def is_math_text(s):
"""
# Did we find an even number of non-escaped dollar signs?
# If so, treat is as math text.
if rcParams['text.usetex']:
if self.get_usetex():
if s == ' ':
s = r'\ '
return s, 'TeX'
Expand Down Expand Up @@ -1256,7 +1256,7 @@ def set_usetex(self, usetex):
`rcParams['text.usetex']`
"""
if usetex is None:
self._usetex = None
self._usetex = rcParams['text.usetex']
else:
self._usetex = bool(usetex)
self.stale = True
Expand Down