Sunday, 25 August 2013

Remove z-axis ticks (only) from R's persp

Remove z-axis ticks (only) from R's persp

I need a 3D perspective plot with tickmarks and labels on the x and y axes
only, but not the z axis. Is this possible with persp? If not, is there
another R library that can do this?
Here is some working code, used only to illustrate what I'm looking for:
x <- seq(-10, 10, length= 30)
y <- x
f <- function(x, y) { r <- sqrt(x^2+y^2); 10 * sin(r)/r }
z <- outer(x, y, f)
persp(x, y, z, theta = 30, phi = 30, ticktype = "detailed")
Finally, this is the desired plot output, which I've edited to erase the z
axis tick marks and labels.

No comments:

Post a Comment