1

I would like to highlight an open space in ggplot2 down and to the right from some point. If I include some points outside of the main plot, ggplot simply changes limits for me. However if I enforce limits, it doesn't draw a rectangle that goes out of the plot.

df <- data.frame(x=runif(10),y=runif(10))
qplot(x,y,data=df) +
    annotate('rect', xmin=.25, ymin=-1, xmax=2, ymax=.25, alpha=.2) +
    ylim(0,1) # try to remove me

I want to make an appearance that highlighted area stretches all the way below -1 and all the way to the right past 2.

tonytonov
  • 24,116
  • 16
  • 77
  • 94
mlt
  • 1,516
  • 1
  • 21
  • 48

0 Answers0