【发布时间】:2011-01-09 14:20:19
【问题描述】:
要在 Python 的 matplotlib 包中用希腊字母注释我的数字,我使用以下内容:
import matplotlib
matplotlib.use('PDF')
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
plt.rcParams['ps.useafm'] = True
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
plt.rcParams['pdf.fonttype'] = 42
# plot figure
# ...
# annotate figure
plt.xlabel(r'$\mu$ = 50')
plt.ylabel(r'$\sigma$ = 1.5')
这使得等号及其右侧的所有内容都按预期使用 Helvetica 字体,而希腊符号默认为通常的 TeX 字体(我认为是 Times New Roman。)
如何使用于希腊字母的字体改为“符号”字体?重要的是不要让它出现在 TeX 的默认 Times 字体中。
感谢您的帮助。
【问题讨论】:
-
通常的 TeX 字体不是 Times New Roman,而是 Computer Modern。只是说。
-
您想要哪种希腊字体? Helvetica 字体中的希腊字母、希腊字体或 Unicode 中的希腊字符?这可能会有所帮助:stason.org/TULARC/travel/greece/…
标签: python latex matplotlib