More or less following what Brian Diggs suggests above,
#sample data
set.seed(666)
dat <- data.frame(x = seq(as.POSIXct('2011-03-27 00:00:00'),
len= (n=24), by="1 hour"), y = cumsum(rnorm(n)))
#Breaks for background rectangles
rects <- data.frame(xstart = as.POSIXct('2011-03-27 15:00:00'),
xend = as.POSIXct('2011-03-27 18:00:00'))
library(ggplot2)
ggplot() +
geom_rect(data = rects, aes(xmin = xstart, xmax = xend,
ymin = -Inf, ymax = Inf), alpha = 0.4) +
geom_line(data = dat, aes(x,y))
Would give you this,
