Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pandas bar plot edge to dash

I have a bar plot and I can successfully turn the fill color to transparent. Now I'd like to change the edge to a dashed line, instead of a solid.

df.plot(kind='barh', x='state', y='population', color=[1,0,0,0], edgecolor='blue', width=0.5)

I've tried edgestyle, I've tried style='-' and '--'.

Is dash-ing only available for line plots?

like image 526
ScottieB Avatar asked Oct 17 '22 18:10

ScottieB


1 Answers

df.plot(kind='barh', x='state', y='population', color=[1,0,0,0], edgecolor='blue', width=0.5, linestyle="--")

like image 198
Kevin Wang Avatar answered Oct 20 '22 09:10

Kevin Wang