Matplotlib barh capstyle ’round’ not working?

I created a barh plot including xerr. For the caps of the errorbars I would like round edges. I tried to set the capstyle in the error_kw, which didn’t work out.

bars = ax.barh(range(3), [1,2,3], 
        align='center', color='silver', height=0.5,
        capsize=12, error_kw={'elinewidth':1, 'solid_capstyle':'round'})

I also tried to access the Line2D objects afterwards to change the capstyle, which also didn’t work out.


Can someone please give me a hint what I’m doing wrong here?


I found the problem now, I had to access the private attribute of the cap. Instead of the method


I had to access the private attribute:

cap._marker._capstyle = "round"

Thanks for your comment anyway @tmdavison