由於某些原因,在我的mpl
圖中使用Times New Roman時,它顯示爲粗體。其他字體都可以。Matplotlib:Times New Roman顯示爲粗體
這裏是一個簡單的例子,其結果(在Word文檔中,與我期望的Times New Roman相比較)。
import matplotlib as mpl
import matplotlib.pyplot as plt
with plt.style.context('word'):
fig = plt.figure(1, figsize=(3.4, 2.1))
ax1 = plt.subplot(111)
ax1.plot([1,2,3,4,5], '+--')
ax1.text(0.5, 3.5, r"Brown $\alpha + 12 \sum_ix$")
ax1.text(0.5, 3, r"1.0 2.0")
ax1.set_xlabel('normal 1.0 and math $1.0$')
ax1.set_ylabel('Times New Roman')
plt.tight_layout()
fig.savefig('word.pdf')
用含有
backend: PS
text.usetex: False
font.family: serif
font.serif: Times New Roman
font.size: 11
axes.titlesize: 11
axes.labelsize: 11
情節的word
樣式表是包含在其實際尺寸(3.4 '' 2.1 '')在文檔中。
字體正確找到,它也在數學模式下工作(請參閱圖中的alpha)。它只是似乎這是大膽的...