[R] Plotting 3d data?

Wesley Tansey tansey at vt.edu
Mon Jun 16 22:57:15 CEST 2008


> If your data is really a bunch of points, not on a grid, then you need 
> to use plot3d() to plot it as points, or convert it to a surface.  The 
> interp() function in the akima package can do that.  (There are lots of 
> other possibilities too.)


Actually, my data is on a grid. The values are something like 0 < x < y <
0.05, with a 0.00005 step for both x and y. I tried using interp() as
follows:

data <- ..

x <- data$X

y <- data$Y

z <- data$Z

temp <- interp(x, y, z)

plot.new()
image(temp, add=TRUE)


I figured showing an image would just verify that the grid was formed
correctly, but that didn't seem to work.


Wesley



More information about the R-help mailing list