解决matplotlib中文乱码问题(Windows)

1.修改matplotlibrc文件
进入Python安装目录下的Lib\site-packages\matplotlib\mpl-data目录,打开matplotlibrc文件,删除font.familyfont.sans-serif两行前的#,并在font.sans-serif后添加微软雅黑字体(Microsoft YaHei)

2.代码中别忘了中文采用unicode编码

PS:

  原文地址: http://www.pythoner.com/200.html

posted @ 2014-09-05 18:29  xiaomi2013  阅读(260)  评论(0编辑  收藏  举报