Two part question: In ggplot, I am trying to increase the spacing between my axes intervals so that when I offset my "raw data" points next to the mean and confidence interval, it is more obvious that the data points belong to the rectangles on the left (e.g., if the gap between 1988 and 1989 was 1 inch on paper, how would I make it 2 inches)?
Secondly, I would like to know if there is a way to create breaks in the axes such that I can eliminate the white space in the years of missing data. Code is below but I am hoping for something that looks like this example
http://gnuplot-surprising.blogspot.com/2011/10/broken-axes-graph-in-gnuplot-3.html
set.seed(1)
mean<-rnorm(100,0,2)
years<-c(1988,1989,1990,2001,2002,2003,2012,2013,2014)
winter<-sample(years, 100,replace=T)
data<-as.data.frame(cbind(mean, winter))
library("Rmisc")
sum<-summarySE(data,measurevar="mean",groupvars=c("winter"))
library(ggplot2)
p<-ggplot(sum, aes(x=winter, y=mean, group=winter))+
geom_rect(aes(ymin=mean-ci, ymax=mean+ci, xmin=winter-.2, xmax=winter+.2), fill="gray")+
geom_point(shape=18, size=3)+
scale_x_continuous(breaks=seq(1985,2014,5))+
scale_y_continuous(breaks=seq(-2,4,1))+
geom_abline(intercept=0,slope=0, lty=2)+
theme_bw()
p2<-p + geom_point(data=data, aes(x=winter+.3,y=mean),shape=1, size=2.5)+
scale_shape()
p2