matplotlib中用中文添加label、legend等出现方框乱码的解决方法
1.打开C:\Windows\Fonts文件夹2.在里面随便找一个你喜欢的中文字体文件,用属性看其文件真实命名。如楷体:simkai.ttf3.在你的画图代码前面添加zhfont1 = matplotlib.font_manager.FontProperties(fname='C:\Windows\Fonts\simkai.ttf') 4.修改画图代码修改前:plt.xlabel(...
原创
2019-03-28 09:28:00 ·
4813 阅读 ·
0 评论