- 执行命令,获取matplotlibrc文件路径
import matplotlib print(matplotlib.matplotlib_fname())
2、下载文件
链接: https://pan.baidu.com/s/1-lDPsuPtE7-prEpPOfZ-Yw 提取码: m7hr
3、修改matplotlibrc
font.family: sans-serif
font.sans-serif: SimHei, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
axes.unicode_minus: False
- 重新加载matplotlib
import matplotlib as mpl
import shutil
shutil.rmtree(mpl.get_cachedir())