1

I have a Dataframe with 14 rows and 7 columns where the columns represent groups and the rows represent months. I am trying to create a grouped bar plot such that at each month (on the x-axis) I will have the values for each of the groups as bars. The code is simply

ax = df.plot.bar(width=1,color=['b','g','r','c','orange','purple','y']);
ax.legend(loc='center left', bbox_to_anchor=(1.0, 0.5))
ax.set_xticklabels(months2,rotation=45) 

Which produces the following result: Grouped Bar Plot

I would like to make the individual bars in each group wider but without them overlapping and I would also like to increase the distance between each group of bars so that there is enough space in the plot. It might be worth mentioning that the index of the dataframe is 0,...,13.

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
TH15
  • 11
  • 2

1 Answers1

0

If you want to pack 10 apples in a box and want the apples to have more space between them you have two options: (1) take a larger box, or (2) use smaller apples.

(1) How do you change the size of figures drawn with matplotlib?
(2) change the width argument.

ImportanceOfBeingErnest
  • 321,279
  • 53
  • 665
  • 712