On 13-09-24 6:19 AM, Babak Bastan wrote:
I do the folloowing in order to get 3D Plot:
y<-1:(point/2)
x<-20:30
z<-r[1:(point/2)]
persp(x,y,z,theta = 135, phi = 30, col = "green3", scale = FALSE,
ltheta = -120, shade = 0.75,
border = 1)
y:
[1] 1 2 3 4 5
x:
[1] 20 21 22 23 24 25
z:
[1] 4811.000000 3.593025 6.968666 4.908174 5.332700
but i always get the error message Error in persp.default(x, y, z, theta =
135, phi = 30, col = "green3", :invalid 'z' argument
How may I solve the issue?
See ?persp. z should be a 5x5 matrix to match your x and y.
Duncan Murdoch
______________________________________________
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.