您当前的位置: 首页 >  matplotlib

静静喜欢大白

暂无认证

  • 2浏览

    0关注

    521博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

【matplotlib】 findfont: Font family [‘Times New Roman‘] not found. Falling back to DejaVu Sans.

静静喜欢大白 发布时间:2021-09-18 00:06:01 ,浏览量:2

1、简介

绘制图时显示缺少字体

2、解决

1、目录 C:\Windows\Fonts 下搜索找到 Time New Roman 字体,包含 ttf 格式的四个文件。 2、将其复制到服务器上 matplotlib 库对应的 fonts/ttf 文件夹下。 上述 ttf 字体文件复制的目标地址为:

/home/anaconda3/envs/pytorch/lib/python3.6/site-packages/matplotlib/mpl-data/fonts/ttf

3、删除之前的缓冲,地址为home/用户/.cache/matplotlib目录,重新运行程序即可。地址中的wbx是用户名,根据实际情况自行更改。找不到cache文件夹是因为其为隐藏文件夹,可ctrl+h将其显示。

3、参考

使用matplotlib时缺失字体,findfont: Font family [‘Times New Roman‘] not found. Falling back to DejaVu Sans.

关注
打赏
1510642601
查看更多评论
立即登录/注册

微信扫码登录

0.0356s