My guess is that your intuition was correct, but you probably executed it incorrectly. Plot (usually) calls a new plotting window; if you want to add to a window that's already open, you need to use a specialized command like points, lines, etc.
Try this x <- y <- 1:10 plot(x,y,type="n"); rect(4,0,6,11,col=5); points(x,y) Hope this helps, Michael Weylandt On Sat, Oct 8, 2011 at 12:53 PM, Heverkuhn Heverkuhn <heverk...@gmail.com> wrote: > Hello everyone, > if I have: > x=1:10 > y=1:10 > plot(x,y) > > and I plot a rectangle > rect(4,0,6,11, col=5) > > it covers the points of the graph. > Is there a way to draw the rectangle under the points? > I was thinking the a solution could be draw an empty plot > then draw the rectangle and after the points, > but it did not work. > Any idea? > > thanks for your help > H. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.