I would like to add minor gridlines to categorical data on plot produced with ggplot2. For example,
library("ggplot2")
data<-data.frame(xcategory=rep(c("a","b","c"),each=30), yvalue=c(1,3,6))
ggplot(data,aes(x=xcategory,y=yvalue,alpha=1.0,size=5))+
geom_point(position=position_jitter(width=0.1,height=0.0))+
theme_bw()+
scale_x_discrete(name="Categorical Data") +
scale_y_continuous(name="Continuous Response",limits=c(0,7)) +
theme(axis.text.x=element_text(angle = 90),legend.position="none")
Produces the following graph:
But what I would like is for the categorical gridlines to bound the category name so that I can jitter all of the data within the gridlines. Here's an example from paint where I made edits in red:
The red lines bounding "b" are probably all that I need, I was just trying to illustrate three columns of equal width.
Help or direction to a similar question that I missed is greatly appreciated. I have tried adding grid information through "theme" with no success.