[英]Plotting with two different labels in X-axis in matplotlib
I have a dataframe like this -我有一个这样的 dataframe -
I want to plot for every date tmax
& tmin
value on y axis.我想为 y 轴上的每个日期tmax
和tmin
值设置 plot。 How can I do this using matplotlib?如何使用 matplotlib 执行此操作?
Use Series.unstack
with DataFrame.plot
:将Series.unstack
与DataFrame.plot
一起使用:
df['Data_Value'].unstack().plot()
Or with DataFrame.plot.bar
:或者使用DataFrame.plot.bar
:
df['Data_Value'].unstack().plot.bar()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.