1. 查看matplotlib配置文件
import matplotlib
print(matplotlib.matplotlib_fname())
Out:{your-matplotlib-installed-path}/mpl-data/matplotlibrc
2. 下载simhei字体
点击下载simhei字体
3. 复制字体文件
将下载的字体文件复制到第一步显示的目录中的相对路径
{your-matplotlib-installed-path}/mpl-data/fonts/ttf
4. 修改配置文件(matplotlibrc)中使用的字体
font.family : sans-serif
font.sans-serif : SimHei
axes.unicode_minus : False
5. 清除用户目录下的.cache/matplotlib文件夹
rm -rf ~/.cache/matplotlib