2
渲染我最近做了一個乾淨的安裝OSX 10.11,裝蟒蛇與Python 3.5,Xcode中,MacTEX都2015年和更新了所有的這些。錯誤的MacOS 10.11
我有一個問題,當我想在matplotlib使用乳膠。
下面是一個簡單的例子:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font', **{'family': 'serif', 'serif': ['Computer Modern']})
rc('text', usetex=True)
b = np.array([10, 11, 12, 13],dtype=np.float)
bStd = np.array([1.4, 0.6, 0.3, 1.1],dtype=np.float)
N = len(b)
ind = np.arange(N,dtype=np.float)
width = 0.8
FS=11
fig, ax = plt.subplots(figsize=(5.9055, 3.937))
Test = ax.plot(ind,b)
yerr = plt.errorbar(ind,b,bStd)
ax.set_title('Lorem ipsum dolor sit amet...', fontsize = FS, family = ['serif'])
ax.set_xticks(ind)
ax.set_xlim([-width, N-1+width])
ax.set_xticklabels(('A','B','C','D'), fontsize = FS, family = ['serif'])
ax.set_ylabel('Value/$X/yy^2$',multialignment="center",fontsize = FS, family = ['serif'])
ax.set_ylim(0,20)
plt.tight_layout()
plt.savefig('Test.pdf', format='pdf',bbox_inches='tight')
當我嘗試在matplotlib使用TeX的,我收到以下內容:
RuntimeError: LaTeX was not able to process the following string:
b'lp'
Here is the full report generated by LaTeX:
我認爲Spyder的不知道如何訪問膠乳。這可能是El Capitan新的無根特性的問題嗎?
我已經在網上搜索,當然#1,但沒有一個建議,我發現那裏,幫我。
你有什麼想法?
我剛開始學習如何使用Python工作,所以我真的很缺乏經驗,這可能會在我的例子中是可見的。
謝謝你的時間。