横坐标轴参数x传入的是df中的列名Month
纵坐标轴参数y传入的是df中的列名Tmax
折线图
上面的图就是折线图,折线图语法有三种
df.plot(x='Month', y='Tmax')
df.plot...饼形图
df.plot(kind='pie', y='Sun')
plt.show()
?...直方图
df2.plot(y='Rain', kind='hist')
#df2.plot.hist(y='Rain')
plt.show()
?...纵坐标的刻度可以通过bins设置
df2.plot(y='Rain', kind='hist', bins=[0,25,50,75,100,125,150,175, 200])
#df2.plot.hist...df.plot更多参数
df.plot(x, y, kind, figsize, title, grid, legend, style)
x 只有dataframe对象时,x可用。