首页 > 编程 > Python > 正文

python matplotlib 中文显示参数设置

2019-11-11 05:19:22
字体:
来源:转载
供稿:网友

来源自我的博客

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'内容'
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表