Hi all!
 
My question is how to colour pixels by z value in persp plot in raster package. Here is an example:
 
 
x <- seq(-1.95, 1.95, length = 30)
y <- seq(-1.95, 1.95, length = 35)
z <- outer(x, y, function(a,b) a*b^2)
r1 <- raster(nrows=35, ncols=30, xmn=0, xmx=30, ymn = 0, ymx = 35)
r1[] <- c(z)
persp(r1)
 
There already exist some function to produce persp plot for anothe classes, but I have no idea how deal with RasterLayer object.
 
Thanks all!
 
OV

	[[alternative HTML version deleted]]

