Bladeren bron

Fixed bug: xkcd and usetex=True not allowed.

Hans Petter Langtangen 9 jaren geleden
bovenliggende
commit
24e420e840
1 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 3 2
      pysketcher/MatplotlibDraw.py

+ 3 - 2
pysketcher/MatplotlibDraw.py

@@ -13,8 +13,6 @@ import os
 import matplotlib
 
 matplotlib.use('TkAgg')
-# Allow \boldsymbol{} etc in title, labels, etc
-matplotlib.rc('text', usetex=True)
 matplotlib.rcParams['text.latex.preamble'] = '\\usepackage{amsmath}'
 
 import matplotlib.pyplot as mpl
@@ -95,6 +93,9 @@ class MatplotlibDraw(object):
         self.mpl = mpl
         if xkcd:
             self.mpl.xkcd()
+        else:
+            # Allow \boldsymbol{} etc in title, labels, etc
+            matplotlib.rc('text', usetex=True)
 
         self.xmin, self.xmax, self.ymin, self.ymax = \
              float(xmin), float(xmax), float(ymin), float(ymax)