python matplotlib 中文显示参数设置

来源:互联网 发布:成都php找工作很难 编辑:程序博客网 时间:2024/05/16 03:29

来源自我的博客

http://www.yingzinanfei.com/2017/02/06/python-matplotlib-zhongwenxianshicanshushezhi/

原因

大致就是matplotlib库中没有中文字体。

每次编写代码时进行参数设置

#coding:utf-8import matplotlib.pyplot as pltplt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签plt.rcParams['axes.unicode_minus']=False #用来正常显示负号#有中文出现的情况,需要u'内容'
0 0