[R] [R ]Plot a colored rectangle under the points of a graph

Robert Baer rbaer at atsu.edu
Sat Oct 8 19:43:05 CEST 2011


This is what you tried? What doesn't work?
x=1:10
y=1:10

plot(x,y, type='n')
rect(4,0,6,11, col=5)

points(x,y)
_______________
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 at 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.


------------------------------------------
Robert W. Baer, Ph.D.
Professor of Physiology
Kirksville College of Osteopathic Medicine
A. T. Still University of Health Sciences
800 W. Jefferson St.
Kirksville, MO 63501
660-626-2322
FAX 660-626-2965



More information about the R-help mailing list