plot最简单的图
选择Month作为横坐标,Tmax作为纵坐标,绘图。
大家注意下面两种写法
#写法1
df.plot(x='Month', y='Tmax')
plt.show()
?...横坐标轴参数x传入的是df中的列名Month
纵坐标轴参数y传入的是df中的列名Tmax
折线图
上面的图就是折线图,折线图语法有三种
df.plot(x='Month', y='Tmax')
df.plot...(x='Month', y='Tmax', kind='line')
df.plot.line(x='Month', y='Tmax')
df.plot.line(x='Month', y='Tmax'...多个y值
上面的折线图中只有一条线, 如何将多个y绘制到一个图中,比如Tmax, Tmin。
df.plot(x='Month', y=['Tmax', 'Tmin'])
plt.show()
?...上图绘制有两个小问题:
legend图例不应该显示
月份的显示用数字不太正规
df.index = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep