xpt
xpt

Reputation: 22994

Pandas, Horizontal Bar Chart With Error Bars

In Pandas, how to make the Error Bars inside horizontal Bar Chart to be horizontal as well?

I tried it and my Error Bars inside horizontal Bar Chart is vertical.

Upvotes: 0

Views: 1619

Answers (1)

joshuahhh
joshuahhh

Reputation: 233

From your code:

means.plot(yerr=errors, ax=ax, kind='barh')

You used yerr, so your error bars are aligned with the vertical axis. Change that to xerr, and the error bars will be horizontal.

Upvotes: 2

Related Questions