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
[EMAIL PROTECTED]
Tel - 020 7905 2113
FAX - 020 7905 2381


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:r-help-
> [EMAIL PROTECTED] On Behalf Of Mauricio Cardeal
> Sent: 25 January 2007 13:19
> To: [email protected]
> 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
> 
> ______________________________________________
> [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.

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

Reply via email to