删除geom_bar中边框的底部边框

问题描述 投票:2回答:1

我正在寻找一种删除geom_bar中添加的不重叠底部边框的方法。我不想使用geom_hline(yintercept = 0, colour = "white")之类的选项,因为它覆盖了原始条的单行像素,听起来听起来很挑剔。我猜想我可能必须直接修改ggproto对象的内部,但是我不知道该怎么做。

示例代码:

plot <- iris %>% ggplot(aes(Species, Sepal.Length, fill = Species)) +
  geom_bar(stat = "summary", fun.y = "mean", colour = "black")

enter image description here

所需的输出:

enter image description here

r ggplot2 geom-bar
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.