1

How do you plot error bars, corresponding to 95% confidence intervals, on a horizontal bar plot in seaborn (i.e. bars from left to right, rather than bottom to top)?

Adding the errorbar="ci" argument does not work for me.

RossB
  • 329
  • 1
  • 2
  • 4

1 Answers1

0
import seaborn as sns
import matplotlib.pyplot as plt

data = {"Group": ["A", "B", "C"], "Value": [5, 7, 9], "Error": [0.5, 1, 0.8]}

sns.barplot(x="Value", y="Group", data=data, xerr=data["Error"], errorbar=('ci', 95))

plt.show()
mks2192
  • 306
  • 2
  • 11