[R] shadow between two lines in plot()
Stephen Tucker
brown_emu at yahoo.com
Wed Aug 1 20:13:17 CEST 2007
see ?rect, or, for more general shapes, ?polygon
## EXAMPLES
plot(c(0,500),c(0,500),type="n",las=1)
rect(par("usr")[1],200,par("usr")[2],300,col="grey90")
points(seq(0,500,length=3),seq(0,500,length=3))
plot(c(0,500),c(0,500),type="n",las=1)
polygon((par("usr")[1:2])[c(1,1,2,2)],
(c(200,300))[c(1,2,2,1)],col="grey90")
points(seq(0,500,length=3),seq(0,500,length=3))
--- "Ding, Rebecca" <RDing at ETS.ORG> wrote:
> Dear R users,
>
> I used the following code to draw a scatter plot.
>
> plot(x,y,type="n")
> points(x,y,pch=1)
>
> And then I used the abline functions to draw two lines. I want to add
> the shadow between those two lines.
>
> abline(h=200)
> abline(h=300)
>
> Any suggestions?
>
> Thanks
>
> Rebecca
>
> --------------------------------------------------
> This e-mail and any files transmitted with it may contain pr...{{dropped}}
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>
More information about the R-help
mailing list