且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 ggplot2 中的条之间添加空间

更新时间:2023-11-26 13:31:52

这是您想要的吗?

hist + geom_bar(width=0.4, position = position_dodge(width=0.5))

  • widthgeom_bar 中决定了条的宽度.
  • widthposition_dodge 中决定了每个条的位置.
    • 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.