Thanks for the image. Note that since you (again) didn't take the
trouble to provide a reproducible example or sample data, the
impression you're sending is that you expect people on this list to do
all your work for you. Which is not a great way to get help. However,
because I happened to have some time this morning, here's something to
get you started--hope it is useful.
library(ggplot2)
theme_set(theme_bw())
# Create sample data
df <- data.frame(obs=1:20,group=LETTERS[1:10], shading=1:2,
known=c(rep(T,10),rep(F,10)),score=runif(20))
# Set up the basic plot
p <- ggplot(df, aes(x=group, y=score))
p <- p + geom_blank() # not sure why I get an error without including this this
# Add background shading, alternating between groups
p <- p + geom_rect(aes(xmin=as.numeric(group)-0.5,xmax=as.numeric(group)+0.5,ymin=-Inf,ymax=Inf,fill=factor(shading)),
alpha=0.2)
# Add the points
p <- p + geom_point(aes(color=known))
# Fine-tune: custom colors, horizontal line, etc.
p <- p + scale_fill_grey(guide=F)
p <- p + scale_color_manual("", values=c("green", "yellow")) # point colors
p <- p + geom_hline(yintercept=0.5)
# Display and save the figure
print(p)
ggsave("sample.pdf")
Ben