浏览代码

Fixed bug: xkcd and usetex=True not allowed.

Hans Petter Langtangen 9 年之前
父节点
当前提交
24e420e840
共有 1 个文件被更改,包括 3 次插入2 次删除
  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)