Your geom_rect() call probably wants to be:

geom_rect(aes(xmin = xstart, xmax = xend, ymin = -Inf, ymax = Inf), fill = "light blue", alpha = 0.2, colour = NA)

because

you don't need to respecify the data arg, and

arg, and you don't want that red/green border.

There's always a little bit of padding on plots, so make sure you have an xstart that is well beyond the limits of the data shown on the plot

xstart <- as.POSIXct("2016-04-23 20:36:21 IST")

Then all you need to do is to set the x axis limits to the limits of the data:

lims <- with(df, range(resolutiondate))

Next we need to use this. If you use xlim() to set the x-axis limits then anything outside these limits, i.e. the start of your rectangle geom, will get thrown out. What you want to use is coord_cartesian() , which takes limits as Date objects just fine:

## Clean up your plot p <- ggplot(df, aes(resolutiondate, age, size = counts, color = factor(isbreached))) + geom_point(alpha = 0.4) + geom_point(shape = 21) + scale_y_continuous(labels = comma) + geom_vline(data=df, aes(xintercept = as.numeric(resolutiondate[300])), color = "blue")

Now set appropropriate start and ends

xstart <- as.POSIXct("2016-04-23 20:36:21 IST") xend <- with(df, resolutiondate[300])

Notice that you need xend to be resolutiondate[300] if you want to draw to the left of an up to this point.

Now add the geom_rect() layer and set the x-limits

p + geom_rect(aes(xmin = xstart, xmax = xend, ymin = -Inf, ymax = Inf), fill = "light blue", alpha = 0.2, colour = NA) + coord_cartesian(xlim = lims)

With that I get: