matplotlib绘制无法显示xlabel与ylabel中文标签
主要原因是中文字体没有加载相应的中文包
将下面的代码加进去就行了
#这个是相应的库
from matplotlib import pyplot
from matplotlib.font_manager import FontProperties
font_set = FontProperties(fname=r"c:\windows\fonts\simsun.ttc", size=15)
#下面的代码放在plt.show之前就可以
pyplot.title(u'标题', fontproperties=font_set)
pyplot.xlabel(u'x轴标签', fontproperties=font_set)
pyplot.ylabel(u'y轴标签', fontproperties=font_set)