下载字体
- 拷贝到anaconda3/lib/python3.7/site-packages/matplotlib/mpl-data/fonts/ttf
- ~/.matplotlib/fontlist-v310.json文件,追加配置
- 清空缓存~/matplotlib/tex.cache 目录
- 画图的时候使用代码:
font = {'family': 'SimHei', 'size': '20'}
plt.rc('font', **font)
matplotlib画图显示中文
参考https://www.jianshu.com/p/240ea3ae0dc9
本文详细介绍了如何在Matplotlib中正确显示中文,包括下载并安装适合的字体,配置matplotlib的字体路径,更新fontlist文件,清空缓存,以及在代码中设置字体属性。
894

被折叠的 条评论
为什么被折叠?



