Re: [R] filling the area

From: Mario Cortina Borja <M.Cortina_at_ich.ucl.ac.uk>
Date: Thu 25 Jan 2007 - 13:43:22 GMT

Hi Mauricio,

Try:

plot(x,y); lines(x,y)
polygon( c(min(x), x, max(x)), c( min(y), y, min(y)), density=100 )

Best wishes,

Mario

Dr Mario Cortina Borja
Senior Lecturer in Statistics
Centre for Paediatric Epidemiology and Biostatistics Institute of Child Health, University College London M.Cortina@ich.ucl.ac.uk
Tel - 020 7905 2113
FAX - 020 7905 2381
> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch [mailto:r-help-
> bounces@stat.math.ethz.ch] On Behalf Of Mauricio Cardeal
> Sent: 25 January 2007 13:19
> To: r-help@stat.math.ethz.ch
> Subject: [R] filling the area
>
> Please, how to fill the area under the curve?
>
> x <- c(1:10)
> y <- c(rnorm(10))
> plot(x,y)
> lines(x,y)
>
> Thanks,
> Mauricio Cardeal
>
> ______________________________________________
> R-help@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.



R-help@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. Received on Fri Jan 26 01:03:15 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 25 Jan 2007 - 14:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.