Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show error bar with standard deviation in a barplot using Seaborn in Python

Tags:

seaborn

I have noticed that sns.barplot uses standard error for error bar as default 1. Is there a way to change it to SD?

ax = sns.barplot(x="day", y="tip", data=tips, ci=???)
like image 761
user3476791 Avatar asked Mar 17 '16 17:03

user3476791


1 Answers

Edit 2017:

Now, there is an option in Seaborn v0.8 to show standard deviation in several plot types. In the particular case of the question:

ax = sns.barplot(x="day", y="tip", data=tips, ci="sd")


The answer is: it is not possible to do it directly.


I had asked the same question in the GitHub issue tracker for this library:

Could it be possible to represent standard deviation bars instead standard error bars in barplots?

I don't know if it is already possible tweaking ci and estimator. If this feature is not too complex to implement in Seaborn, I could help to develop it as much as I can.

The developer of this library (mwaskom) answered:

No, it's not possible, sorry.

like image 54
Chuck Daniels Avatar answered Sep 26 '22 15:09

Chuck Daniels