【python】matplotlib中文乱码问题

http://www.pythoner.com/200.html

改matplotlibrc文件
进入Python安装目录下的Libsite-packagesmatplotlibmpl-data目录,打开matplotlibrc文件,删除font.family和font.sans-serif两行前的#,并在font.sans-serif后添加微软雅黑字体(Microsoft YaHei),代码如下:

matplotlibrc文件修改Python

font.family : sans-serif
font.sans-serif : Microsoft YaHei, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif

原文地址:https://www.cnblogs.com/colipso/p/4288909.html