【发布时间】:2018-02-25 20:11:00
【问题描述】:
我的问题与 stibu 的 answer 有关。我正在使用geom_bar,并且我试图将条形置于 x 轴刻度之间的中心(参见答案的第二张图)。
这是一个例子:
grp<-letters[1:13]
count<-c(38,591,549,487,419,363,276,276,164,68,31,10,5)
data<-data.frame(grp,count)
ggplot(data,aes(x=grp,y=count))+geom_bar(stat="identity")
这给出了以下内容:
- 我的 x 轴由字符变量组成,所以我不能使用“+0,5”技巧。
- 没有
boundary或center建议的geom_bar 选项here
那么如何对齐条形,使其左边框与刻度线对齐?
我使用的是 R 版本 3.4.0 和 RStudio 1.0.143。
【问题讨论】: