Hannu Kahra wrote:
Hi,

I have a graph with seven parallel horizontal lines. Is it possible to
shade the area between two adjacent lines?

Hi Hannu,
Easy if you know the endpoints of the lines.

plot(rep(1,2),type="l",ylim=c(0,8))
for(i in 1:6) {
lines(rep(i+1,2))
polygon(c(1,1,2,2),c(i,i+1,i+1,i),col=i)
}

Jim

______________________________________________
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.

Reply via email to