Python matplotlib:如何绘制底部和最高值的垂直条
是否有一种方法可以绘制并非全部从相同基线开始并具有自己的最高值,而是指定底部值和最高值?
换句话说,如果我有以下数据框架:
import pandas as pd
data={'Seconds':[10,20,30,40],'SYS':[95,103,99,112],'DIA':[56,75,62,70]}
df = pd.DataFrame(data)
由此我需要显示4个bar,x轴上的“秒”值和4个bar,以DF ['DIA']值开始在DF [sys']值中的栏
是可能的
Is there a way to plot bars which do not all start from the same baseline and have their own top value, but rather specify both a bottom and a top value?
In other words if I had the following dataframe:
import pandas as pd
data={'Seconds':[10,20,30,40],'SYS':[95,103,99,112],'DIA':[56,75,62,70]}
df = pd.DataFrame(data)
and from this I would need to show 4 bars, with the 'Seconds" values on the X axis and four bars which would start with at the df['DIA'] value and the top of the bar at the df['SYS'] value.
Is it possible? Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以执行以下操作:
输出:
You can do the following:
output: