简体   繁体   English

在 matplotlib 的 X 轴上绘制两个不同的标签

[英]Plotting with two different labels in X-axis in matplotlib

I have a dataframe like this -我有一个这样的 dataframe -

1个

I want to plot for every date tmax & tmin value on y axis.我想为 y 轴上的每个日期tmaxtmin值设置 plot。 How can I do this using matplotlib?如何使用 matplotlib 执行此操作?

Use Series.unstack with DataFrame.plot :Series.unstackDataFrame.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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM