[R] overlap contour

Ben Bolker bolker at ufl.edu
Wed May 13 15:30:04 CEST 2009

Bala subramanian-2 wrote:
> Friends,
> I have two covariance matrices (m1 and m2) of same size (150x150). I used
> contourplot function to make contour plots individually (c1 and c2). I am
> interested in making one contourplot overlapping the two individual
> contours
> so that the portion of the plot above and below the diagonal can represent
> the c1 and c2. Someone suggest me how can i do the same.
> Is there any way that i can combine m1 and m2 and write the combined
> matrix
> to a file and plot it to achieve the mentioned above.

I'm not quite sure what you mean (and this may be why no-one has responded
so far).

Do you mean

m2[lower.triang(m2)] <- m1[lower.triang(m1)]


  I can imagine a fancier solution where you use contourLines to
extract the contour lines, remove points where x>y, and plot them,
but that seems like more work.

 Ben Bolker

View this message in context: http://www.nabble.com/overlap-contour-tp23520206p23521760.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list