Wireframe plot with small values in R

462 views Asked by At

I have data with very small values between -1 to 1 in X, Y and Z values between -1 to 1 like below

X,Y,Z
-0.858301,-1,1.00916
-0.929151,-1,1.0047
-0.896405,-0.940299,1.00396
-0.960967,-0.944075,1.00035

wireframe(Z~X+Y,data=sol)

Seems wireframe works only with larger values (1, 2, 3...) , How do I plot small values?

2

There are 2 answers

8
keegan On BEST ANSWER

wireframe might be use in one of two ways -

With a rectangular data matrix where the values of x and y are implied by the shape of the matrix.

wireframe(matrix(rnorm(100),ncol=5),drape=TRUE)

Or with a dataframe, where the values of x and y are explicit, and here you can use a formula for the relationships between the columns.

df<-expand.grid(x = seq(0,.1,.01), y = seq(0,.1,.01))
df$z<-rnorm(121)
wireframe(z~x*y,data=df,drape=TRUE)
0
Valerie S On

I've found that if you include the line defining the z axis limits, then you can't draw it below 1. But if you take out the defined axis limits, and let R graph it itself, then it works and you can graph small numbers.