[R] number of ticks in a persp() plot

Duncan Murdoch murdoch at stats.uwo.ca
Sun Mar 29 12:32:16 CEST 2009


On 28/03/2009 9:42 PM, a s wrote:
> Hi, I am trying to specify four ticks (at 0,1,2,3 for the y axis) in a persp
> plot but the defaults overrule my specification and I obtain seven of them.
> Is it possible to gain full control over them in such a plot? Here is my
> code:
> 
> matlines=matrix(c(1:7,3:9,3:9,2:8),nrow=7,ncol=4)
> persp(x=seq(1,7,1),y=seq(0,3,1),z=matlines,theta=-30,phi=25,zlim=c(0,10),d=5,ticktype="detailed",xlab="x",
> ylab="y",zlab="z")

I don't think there is any way to specify the locations with persp. 
(You can use nticks=4 to reduce the number of ticks on all axes.) 
persp3d in the rgl package gives you more control, but with less 
flexibility about graphics devices.

Duncan Murdoch




More information about the R-help mailing list