Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change space between bars when drawing multiple barplots in pandas?

I am drawing multiple barplots using the following DataFrame.plot call:

df.plot(kind='bar',
         stacked=False, 
         figsize=figsize,
         rot=0,
         alpha=0.5, 
         width=width)

However, I want to increase the size between the bars within each category. How can I achieve this?

Current Output

like image 345
kyrre Avatar asked Jan 08 '16 10:01

kyrre


1 Answers

You can define an edge around your bars and change its width:

df.plot(kind='bar', edgecolor='white', linewidth=3)

It works if you want to change the space between bars within a group.

like image 198
Navid Roohani Avatar answered Nov 13 '22 20:11

Navid Roohani