Skip to content
Prev 170305 / 398503 Next

contour plot or persp plot with log scale?

On 2/12/2009 12:04 PM, Gilbert Brenes wrote:
For persp or persp3d I think you'd have to do the log transformation 
yourself.  For example,

x <- 1:100
y <- 1:100
z <- outer(x,y, function(x, y) exp(x/10 + y/10)
logz <- log(z, 10)
persp3d(x,y,logz, axes=FALSE, zlab="z", col="red")
axes3d(c("x", "y"))
axis3d("z", at=pretty(logz), labels=10^pretty(logz))

Duncan Murdoch