您好,我已经成功添加了柱状图中的一条线,但位置不正确。我想使点位于每个柱子的正中间。有人可以帮忙吗?
>>> df
price cost net
0 22.5 -20.737486 1.364360
1 35.5 -19.285862 16.695847
2 13.5 -20.456378 -9.016052
3 5.0 -19.643776 -17.539636
4 13.5 -27.015138 -15.964597
5 5.0 -24.267836 -22.618819
6 18.0 -21.096404 -7.357684
7 5.0 -24.691966 -24.116106
8 5.0 -25.755958 -22.080329
9 25.0 -26.352161 -2.781588
fig = plt.figure()
df[['price','cost']].plot(kind = 'bar',stacked = True,color = ['grey','navy'])
df['net'].plot('o',color = 'orange',linewidth=2.0,use_index = True)