解决Matplotlib中文显示乱码

2019-01-12  本文已影响11人  音符纸飞机
1.找到matplotlib的配置文件文件matplotlibrc
import matplotlib
matplotlib.matplotlib_fname()
2. 配置文件中的下面两行前的井号删去,simhei对应黑体
font.family         : sans-serif
font.sans-serif     : simhei, DejaVu Sans, Bitstream Vera Sans, Computer Modern Sans Serif, L....
3.将系统的黑体字体或其他字体(.ttf结尾的字体)复制到...\matplotlib\mpl-data\fonts\ttf目录中,必须与配置文件相对应
4.清空C:\users<用户>\.matplotlib目录
上一篇 下一篇

猜你喜欢

热点阅读