- 将字体拷贝到matplotlib安装位置,如:
C:\Python27\Lib\site-packages\matplotlib\mpl-data\fonts- 修改配置文件 ,如:
C:\Python27\Lib\site-packages\matplotlib\mpl-data/matplotlibrc
- backend : TkAgg #mac需要修改,windows默认就是TkAgg
- font.family : Microsoft YaHei(去掉开头的#,去掉原来的字体型号)
- font.serif : Microsoft YaHei, ......(去掉开头的#,后面的不变,只在前面加雅黑字体)
font.family : Microsoft YaHei
font.serif : Microsoft YaHei,Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
OK, 大功告成,试试效果吧
网友评论