Sorry, got the answer (ticktype):

persp(x, y, z1,box = TRUE, axes = TRUE,ticktype="detailed")

Thanks!
D.


On Sun, Nov 18, 2012 at 8:20 PM, Dimitri Liakhovitski <
dimitri.liakhovit...@gmail.com> wrote:

> Dear R-ers,
>
> I have 3 vectors - x, y, and z and want to plot a surface (z as the 3rd
> dimension):
>
>  x<- c(-1,-0.75,-0.5,-0.25,0,0.25,0.5,0.75,1)
>  y<- c(-1,-0.75,-0.5,-0.25,0,0.25,0.5,0.75,1)
>  z<- c(0.226598762,    0.132395904,    0.14051906,        0.208607098,
> 0.320840304,
>  0.429423216,    0.54086732,        0.647792527,    0.256692375,
>         0.256403273,    0.172881269,    0.121978079,    0.156718831,
> 0.17175081,
>  0.32791861,        0.420194456,    0.493195109,    0.619020921,
>         0.278066455,    0.199822296,    0.140827896,    0.140139205,
> 0.206984231,
>  0.2684947,        0.340728872,    0.422645622,    0.501908648,
>         0.285697424,    0.22749307,        0.16881002,
> 0.13354722,        0.149532449,
>  0.213353293,    0.283777474,    0.355946993,    0.427175997,
>         0.294521663,    0.236133131,    0.18710497,        0.14828074,
>     0.145457711,
>  0.182992988,    0.228281887,    0.291865148,    0.341808458,
>         0.271987072,    0.252962505,    0.201123092,    0.162942848,
> 0.14828074,
>  0.167205292,    0.214481881,    0.27141981,        0.332162403,
>         0.268966875,    0.253628745,    0.213509108,    0.180342353,
> 0.151623426,
>  0.1617176,        0.192572929,    0.243404723,    0.301780548,
>         0.284462825,    0.25473406,        0.215401758,    0.202840815,
> 0.171061666,
>  0.160368388,    0.183680312,    0.226156887,    0.272598273,
>         0.305655289,    0.247134344,    0.235118253,    0.214725129,
> 0.185684599,
>  0.167917048,    0.184066896,    0.218763431,    0.256692375)
>
> # One method:
> z1 <- matrix(z, 9, 9)
> z1[1,1]<-NA
> persp(x, y, z1)
>
> # Another method:
> library(lattice)
> g <- expand.grid(x = x, y = y)
> g$z <- z
> wireframe(z ~ x * y, data = g)
>
> Is there a way to show the values of x and y on the axes?
> Thank you very much!
>
> --
> Dimitri Liakhovitski
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Dimitri Liakhovitski
marketfusionanalytics.com

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to