【发布时间】:2018-02-06 15:38:09
【问题描述】:
在 matplotlib 中使用数学输入时,如何将字体设置为 Times New Roman。默认字体为斜体,我正在尝试使其与其他轴标题匹配。
我正在尝试使用 \mathrm{}:
plt.xlabel(r"$\frac{\mathrm{1}}{{\mathrm{Distance}}^2 \ (\mathrm{m}^2)}$")
按照 matplotlib 网站 (https://matplotlib.org/users/mathtext.html) 的建议,但它仍然显示为无衬线字体。有没有办法把它变成Times new Roman?谢谢!
【问题讨论】:
-
这里混杂了一些东西。您是在谈论字体本身(例如 Arial、Helvetica、Times New Roman)还是字体样式(例如正常、斜体、粗体)?
标签: python matplotlib