I have created a surface 3D plot.
library(emdbook)
params <- c(a0=0.387217066,a1=0.328086337,a2=0.004177033,
p0=1.117997,p1=5.426564,p2=-220.745499)
Age<- as.matrix(seq(0:299))
Preci<-as.matrix(seq(from=10, to=3000, by=10))
curve3d(with(as.list(params),
a0*(Age^a1)*exp(-a2*Age)*
p0*(1-exp(-exp(-p1)*(Preci-p2)))),
varnames=c("Age","Preci"),
xlim=c(0,300),ylim=c(10,3000),
sys3d="persp", col='gray',
xlab = "Stand Age", ylab = "Annual precipitation", zlab = "GPP",
phi = 25, theta = 40)
However, the colour scale is grey and I would like to have it related to my z-values (GPP). Anyone knows how to do it?