admin管理员组

文章数量:1594755

识别字体

使用字体识别网站(我这里用的是这个)识别。

添加字体

  1. 善用搜索,找到并下载.ttf格式字体,因为matplotlib只支持ttf格式字体,如果无法直接找到ttf格式,可以利用在线格式转换。
  2. 将找到的ttf格式文件分别复制到import matplotlib print(matplotlib.matplotlib_fname())找到的同目录下的fonts文件夹和C:\Windows\Fonts里面,会提示你安装,点确定安装即可。
  3. 删除matplotlib.get_cachedir()找到的目录下的fontlist-vxxx.json缓存文件,之后matplotlib会自动重新生成。
  4. 如果使用的是Jupyter Notebook需要重启,运行以下代码
import matplotlib.font_manager

a = sorted([f.name for f 

本文标签: 字体Pythonmatplotlib