Adding space between bars in ggplot2

Is this what you want?

hist + geom_bar(width=0.4, position = position_dodge(width=0.5))
  • width in geom_bar determines the width of the bar.
  • width in position_dodge determines the position of each bar.

Probably you can easily understand their behavior after you play with them for a while.

enter image description here

Leave a Comment