Adding space between bars in ggplot2

后端 未结 1 1951
不思量自难忘°
不思量自难忘° 2020-11-28 07:53

I\'d like to add spaces between bars in ggplot2. This page offers one solution: http://www.streamreader.org/stats/questions/6204/how-to-increase-the-space-between-the-bars-i

相关标签:
1条回答
  • 2020-11-28 08:38

    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

    0 讨论(0)
提交回复
热议问题