[R-sig-eco] plot intersecting planes

Holland, Jeffrey D jdhollan at purdue.edu
Fri Mar 2 17:09:18 CET 2012


Hello Tenan,
   If very good graphics are the main goal, one option is to use POV-Ray to plot the planes. I know POV-Ray and R talk to each other, but I have had luck simply taking equations output from R and then plotting them in POV-Ray. I'd be happy to advise on this latter option, or others may have insight into sending results directly between the programs.
   Cheers,
   Jeff
__________________
Jeffrey D. Holland
Assoc. Prof. of Landscape Ecology & Biodiversity
Dept. of Entomology, Purdue University


-----Original Message-----
From: r-sig-ecology-bounces at r-project.org [mailto:r-sig-ecology-bounces at r-project.org] On Behalf Of Simone Tenan
Sent: Friday, March 02, 2012 10:33 AM
To: r-sig-ecology at r-project.org
Subject: [R-sig-eco] plot intersecting planes

Hi all,

I need to plot two intersecting planes in a graph. Using persp() function (see code below) I am not able to add a second plane with good results.
I tried with par(new=TRUE) but the output was very poor.
I have found some previous discussions about this point but (apparently) without a clear solution.
Any advice would be appreciated.

Simone Tenan

##################
library(popbio)
fec<-seq(0.1,2,0.1)
delta <- seq(0,0.6,0.05)
lambda<-matrix(0,length(fec),length(delta))
S0=0.7
S1=0.8
S2=0.85
S3=S2
for (j in 1:length(delta)){
    for (i in 1:length(fec)){
        F1=0
        F2=fec[i]*0.05
        F3=fec[i]*0.3
        M<-matrix(0,3,3)
        M[1,]<-c(F1,F2*S0*(1-delta[j]),F3*S0*(1-delta[j]))
        M[2,]<-c(S1*(1-delta[j]),0,0)
        M[3,]<-c(0,S2*(1-delta[j]),S3*(1-delta[j]))
        lambda[i,j]<-eigen.analysis(M)$lambda
        }
}
res <- persp(fec,delta,lambda,xlim = range(fec), ylim = range(delta),shade=T,theta = 230, phi = 20, expand = 0.8, col =
"lightblue",ticktype="detailed")
lines(trans3d(c(2,2,0.1,0.1,2), c(0.6,0,0,0.6,0.6),
c(1,1,1,1,1),res),col="blue")

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list