[R] Help in persp (VERY URGENT ASSISTANCE)
Sundar Dorai-Raj
sundar.dorai-raj at pdf.com
Wed Mar 16 19:15:25 CET 2005
Lakshmi Dhevi Baskar wrote on 3/16/2005 12:02 PM:
>
> Dear All,
>
> I am very new to R projects.May be i am wrong in some steps.I have given the code which i tried for drawing 3d surface using persp.I need to label the axes with scales
>
> z <- array(topnew2$V2, dim=c(600,2))
> x <- 10 * (1:nrow(z))
> y <- (1:ncol(z))
> persp(x, y, z, theta = 30, phi = 30, expand = 0.5, col = "lightblue", xlab ="fluidlevel", ylab ="time", zlab = "probability",xlim=range(x),ylim=range(y))
>
>
>
> I have a text file of format:
>
> V1 V2 V3
> 1 1 0 10
> 2 1 0 20
> 3 1 0 30
> 4 1 0 40
> 5 1 0 50
> ..................
> now i converted to matrix as "z"
>
> z:............
> [,1] [,2]
> [1,] 0 0
> [2,] 0 0
> [3,] 0 0
> [4,] 0 0
> [5,] 0 0
> [6,] 0 0
> [7,] 0 0
> [8,] 0 0
> ...................
>
>
>
> i need to label x axis with scale from 10 to 6000 with length of 10
> and y axis with 1 and 2
> and z from 0 to 1(probabilty)
>
>
> kindly guide me...(may be i have misunderstood some concepts in commands)...
>
> thanks in advance for the help and patience
>
>
Lakshmi,
Have you tried using persp(..., ticktype = "detailed", nticks = 10)?
This is found in ?persp.
--sundar
More information about the R-help
mailing list