Pandas不对称错误栏

2024-05-16 11:05:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我想用熊猫画出不对称的误差条。根据official docs这应该行得通

df = pd.DataFrame([[1,0.2,0.7]])
fig, ax = plt.subplots()
df[0].plot.bar(yerr=[df[1], df[2]], ax=ax)

但是pandas将errorbar呈现为df[1],用于上限和下限(-0.2/+0.2等于-0.2/+0.7):

enter image description here

我在哪里出错?在

我在Windows7下使用了pandas v0.20.3和PythonV2.7.13。在


Tags: docsdataframepandasdfplotfigbarplt