如何更改包括乳胶零件在内的Matplotlib标签的字体?
我正在使用matplotlib绘制图形。由于在报告中使用它,因此我希望字体能够匹配报告本身的字体。我在下面找到了可以更改标签字体的方法,但它不会更改标签的乳胶部分的字体。无论如何是否有更改乳胶字体样式?
import matplotlib.font_manager as fm
prop = fm.FontProperties(fname='/root/Fonts/AdobeDevanagari-Regular.otf')
ax[0].set_ylabel('$\mathrm{\chi}_{v}^{2}$ /-', fontproperties=prop, fontsize = si1)
另外,我希望能够从个人字体中选择,而不是预先构建的字体,因此我导入OTF文件的原因。
I am drawing a graph using Matplotlib. As it is being used in a report I want the fonts to match that of the report itself. I've found this method below which works to change the font of the label but it doesn't change the font of the LaTeX part of the label. Is there anyway of changing the LaTeX font style?
import matplotlib.font_manager as fm
prop = fm.FontProperties(fname='/root/Fonts/AdobeDevanagari-Regular.otf')
ax[0].set_ylabel('$\mathrm{\chi}_{v}^{2}$ /-', fontproperties=prop, fontsize = si1)
Also, I want to be able to pick and choose from personal fonts not the prebuilt in ones hence the reason I imported the otf file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论