I have a dataframe as you can see in the image. I want to add to my plot the error bars (this is "std" column).
I have only managed to plot the bars, but not the errors.
I checked this answer: enter link description here The answer uses a Facetgrid. I need a Factorplot.
Here is my code:
#Seaborn --ploteo de barras
sns.set(style="white")
g = sns.factorplot(x="Stage", y="Mean_Acc", hue='Clf', data=df, size=4, aspect=3, kind="bar",
legend=False)
g.set(ylim=(0, 120))
g.despine(right=False)
g.set_xlabels("")
g.set_ylabels("")
g.set_yticklabels("")
mylegend=plt.legend(bbox_to_anchor=(0., 1.1, 1., .102), prop ={'size':10}, loc=10, ncol=8, #left, bottom, width,
title=r'BEST STAGE AFTER OPTIMIZATION') #height, loc='center'
mylegend.get_title().set_fontsize('24')
ax=g.ax
def annotateBars(row, ax=ax):
for p in ax.patches:
ax.annotate("%.2f" % p.get_height(), (p.get_x() + p.get_width() / 2., p.get_height()),
ha='center', va='center', fontsize=11, color='gray', rotation=90, xytext=(0, 20),
textcoords='offset points')
plot = df.apply(annotateBars, ax=ax, axis=1)