I have constructed a MultiIndex column Dataframe and plot it in grouped horizontal bars. The grouping is on MultiIndex level 1, which I have solved with unstack()
for the plot.
I would like to add the xerr bar to the plot, however it is not displayed.
Here is the dataframe:
level_0: observer_1 observer_2 observer_3
level_1: meas1 meas2 meas3 meas1 meas2 meas3 meas1 meas2 meas3
index:
val 3 1 5 2 0.5 4 2 2 4.5
std 0.1 0.2 0.01 0.15 0.01 0.2 0.03 0.1 0.01
Here is my code and the plot:
dfSTD = df.loc['std',:].to_frame()
dfVal = df.loc['val',:].to_frame()
dfVal.unstack(level=0).plot(kind='barh', ax=axis[0], xerr=dfSTD.unstack(level=0))