Skip to content
Back to formatted view

Raw Message

Message-ID: <3A822319EB35174CA3714066D590DCD504AF77F7@usrymx25.merck.com>
Date: 2004-02-19T16:46:25Z
From: Liaw, Andy
Subject: filling the area between two curves in a plot

Assuming the coordinates for the two curves are x1, y1, x2 and y2, and that
the pairs are sorted by x1 and x2, respectively.  Then just do something
like:

polygon(c(x1, rev(x2)), c(y1, rev(y2), ...)

HTH,
Andy

> From: Rajarshi Guha
> 
> Hi,
>   does anybody know how I can color the area enclosed between 
> two curves
> on a plot?
> 
> Thanks,
> 
> -------------------------------------------------------------------
> Rajarshi Guha <rxg218 at psu.edu> <http://jijo.cjb.net>
> GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
> -------------------------------------------------------------------
> A debugged program is one for which you have not yet found the
> conditions that make it fail.
> -- Jerry Ogdin
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
> 


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments,...{{dropped}}