[R] Cannot set wireframe ticks?
Deepayan Sarkar
deepayan.sarkar at gmail.com
Tue Nov 24 12:19:46 CET 2009
On Tue, Nov 24, 2009 at 10:02 AM, Fredrik Johansson <fredjoha at gmail.com> wrote:
> I have an issue when making a wireframe plot. I can't find any way to
> change the number of ticks on the labels. I try to set it in the code
> below with z.ticks=1, but that doesn't work. Is there anything that
> works? (Note. I need to use wireframe. persp is out of the question
> since I want mathematics in the axis labels).
>
> Here is some sample code:
>
> library(lattice)
> x <- as.matrix(seq(0,pi,0.1))
> z <- sin(x) %*% t(sin(x))
> dim(z) <- NULL
> xy <- expand.grid(x,x)
> w <- data.frame(xy[,1],z,xy[,2])
> colnames(w) <- c('x','z','y')
> wireframe(z~x*y, data = w,
> xlab = expression(italic(x)),
> ylab = expression(italic(y)),
> zlab = expression(sin(italic(x*y))),
> screen = list(z=25,x=-60),
> scales = list(z.ticks=1, arrows=FALSE))
'tick.number' should work (as described in ?xyplot). If you want it
for z only, use
scales = list( arrows=FALSE, z = list(tick.number=1)))
etc.
-Deepayan
More information about the R-help
mailing list