label不显示
来源:5-4 Pandas绘图之Series

zxytxwdy
2017-12-30
请问老师,第一个的label怎么不显示呢?
写回答
1回答
-
您好,您这个应该叫legend图例。在subplot里显示legend,需要调用ax的legend方法,例如:
figure, ax = plt.subplots(2,1)
ax[0].plot(x, y1, label='x', color='r')
ax[0].legend()
ax[1].plot(x, y2, label='y')
ax[1].legend()
plt.show()
012017-12-30
相似问题