【问题标题】:Remove area between x axis and x ticks [duplicate]删除x轴和x刻度之间的区域[重复]
【发布时间】:2016-12-06 09:13:04
【问题描述】:

我想删除 x 轴和 x 刻度之间的空间。这将是红色矩形中的区域。 例如。

ggplot(mtcars, aes(factor(cyl))) + geom_bar()

我发现了大量关于 x 标签间距的信息,但没有关于 x 标签和 x 轴之间的距离的信息。

【问题讨论】:

    标签: r graph ggplot2


    【解决方案1】:

    只需将scale_y_continuous(expand = c(0,0)) 添加到您的ggplot

    ggplot(mtcars, aes(factor(cyl))) + geom_bar() + 
      scale_y_continuous(expand = c(0, 0))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-14
      • 2013-12-23
      • 1970-01-01
      相关资源
      最近更新 更多