Williams Scott wrote: > Hi all, > > I want to create a simple plot with 2 type='s' lines on it: > > plot(a, b, type='s') > lines(x, y, type='s') > > I wish to then fill the area between the curves with a colour to > accentuate the differences eg col=gray(0.95). I cant seem to come up > with a simple method for this. Any pointers in the right direction much > appreciated. > > I don't think there is a really simple method for this. I'd start with converting the two 's' lines to ordinary lines along the lines of
N <- length(a) a1 <- c(a[1],rep(a[-1],each=2),a[N]) # possibly a[N]+a_bit for the final step) b1 <- rep(b,each=2) x1, y1 similarly, then polygon(c(a1,rev(x1)),c(b1,rev(y1), col="grey") (Did I confuse 's' and 'S'? Anyways, you get the idea) > Cheers > > Scott > _____________________________ > > Dr. Scott Williams > > MBBS BScMed FRANZCR > > Peter MacCallum Cancer Centre > > Melbourne, Australia > > [EMAIL PROTECTED] > > ______________________________________________ > [email protected] 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. > -- O__ ---- Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 ______________________________________________ [email protected] 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.
