matplotlib如何正常显示中文

画图之前加上:

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

猜你喜欢

转载自blog.csdn.net/maverick_7/article/details/79681218
今日推荐