My question is related to this answer by stibu. I am using geom_bar
and I am trying to center the bars between the x-axis ticks (see the second graph of the answer).
Here is an example:
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")
Which gives the following:
- My x axis is made of character variables so I can not use the "+0,5" trick.
- There is no
boundary
orcenter
option for geom_bar as suggested here
So how do I align bars so that their left border is aligned with the tick?
I am using R version 3.4.0 and RStudio 1.0.143.