data structures - stack contour plot in R -


i have 2 different matrices (same x , y axis) plot contour plots contour (x,y,z). figure out how stack both matrix single plot in r.

i've been trying use as.layer function doesn't work

heteroplot <- contour(a[,1],t(a[,1]),nlevels=7,heterocov^2,col="green",xlab="ppm",ylab="ppm",bty="n")  homocov <- contour(a[,1],t(a[,1]),nlevels=7,cova^2,col="red",xlab="ppm",ylab="ppm",bty="n")  as.layer(homocov,x.same = true, y.same = true) 

thanks!

you can this, if i've understood correctly, using add argument contour(). example:

x <- -6:16 y <- x z1 <- outer(x, sqrt(abs(x)), fun = "/") z2 <- outer(x, abs(x), fun = "/") contour(x, x, z1) contour(x, x, z2, add = true, col = "red") ## overlay second contour 

which gives:

overlaid contours

not sure as.layer function comes from...?


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -