Matplotlib需要使用下载字体gill sans的帮助字体系列是什么

Matplotlib需要使用下载字体gill sans的帮助字体系列是什么,matplotlib,Matplotlib,这里没有。我无法找出正确的matplotlib行来使用新加载的gillius字体 所以我在我的机器上安装了arkandis digital foundry的gillius字体 吉利斯 这是我“认为”它放在这里的地方 usr/share/font/truetype/adf/GilliusADF-Regular.otf:Gillius ADF:style=Regular 因此,如果我想在导入matplotlib的Python 3.4程序中使用它。我设置了font_family='Gillius',但

这里没有。我无法找出正确的matplotlib行来使用新加载的gillius字体

所以我在我的机器上安装了arkandis digital foundry的gillius字体 吉利斯

这是我“认为”它放在这里的地方

usr/share/font/truetype/adf/GilliusADF-Regular.otf:Gillius

ADF:style=Regular

因此,如果我想在导入matplotlib的Python 3.4程序中使用它。我设置了font_family='Gillius',但程序找不到它。请问,我应该将font_family设置为什么来使用我的字体

下面是来自python程序的示例消息

警告(来自警告模块): 文件 “/usr/lib/python3/dist packages/matplotlib/font_manager.py”,第1279行

(prop.get_family(),self.defaultFamily[fontext])) 用户警告:findfont:Font 找不到家族['Gillius'],正在退回到比特流Vera 桑

警告(来自警告模块): 文件 “/usr/lib/python3/dist packages/matplotlib/font_manager.py”,第1289行

用户警告) UserWarning:findfont:无法匹配:family=Bitstream Vera Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=20.0。 返回/usr/share/matplotlib/mpl data/font/ttf/cmmi10.ttf

我已经尝试使用建议的链接

但它似乎没有任何作用。我的问题是假设字体安装正确,我应该输入什么字体系列让matplotlib使用它?

好的,我“认为”这是一种基于我得到的所有巨大帮助的方法。谢谢大家。我是matplotlib的新手,所以如果我搞砸了,我很高兴纠正它

import matplotlib
import matplotlib.font_manager as fm
from matplotlib import pyplot as plt


font = fm.FontProperties(
       family = 'Gill Sans',
       fname = '/usr/share/fonts/truetype/adf/GilliusADF-Regular.otf')

data = range(5)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.bar(data, data)
plt.ylabel('some y numbers')
plt.xlabel('some x numbers')
ax.set_yticklabels(ax.get_yticks(), fontproperties = font)
ax.set_xticklabels(ax.get_xticks(), fontproperties = font)
ax.set_title('this is a test of Gill sans font')
plt.show()

可能重复Hey Tom谢谢你的回答,但我在问题中提到了这一点,并说它不起作用。无论如何,谢谢你可能会有所帮助…Hey Primer spot on,谢谢你找到它。尽管我进行了搜索,但我还是有点不好意思没有找到它。我发现向linux的过渡和学习Python有点破坏灵魂。太多了事情必须谨慎,但我想这是与领土有关的。