提问人:quantc0d32 提问时间:11/6/2023 最后编辑:quantc0d32 更新时间:11/6/2023 访问量:26
Fontawesome 图标在 pyplot 中显示不正确
Fontawesome icons displayed incorrectly in pyplot
问:
我有一些 pyplot 图表,其中包含使用 fontawesome 图标的注释。 过去一切正常,直到我需要将我的 Python 解释器从 3.10 更新到 3.11。
现在,例如,一个简单的左箭头看起来像这样:左箭头
这是我正在使用的代码:
from matplotlib import pyplot as plt
import matplotlib.font_manager as fmgr
path = '...\\fontawesome-free-5.15.4-desktop\\fontawesome-free-5.15.4-desktop\\otfs\\'
prop = fmgr.FontProperties(fname=path + 'Font Awesome 5 Free-Solid-900.otf', size=2)
plt.text(0.5,0.5,fa.icons['arrow-left'], fontproperties=prop)
我还使用以下代码在字体管理器中添加了字体,但没有成功:fmgr.fontManager.addfont(path + 'Font Awesome 5 Free-Solid-900.otf')
目前我正在使用 matplotlib==3.8.1,降级到以前的版本(如 3.7.3)没有帮助
我搜索了很多,但找不到与我的问题类似的东西,因此如果有人能提供帮助,那就太好了。
谢谢 基利安
答: 暂无答案
评论