On 16/06/2008 4:57 PM, Wesley Tansey wrote:
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)

Normally you would not use plot.new(), and you would skip add=TRUE. Let image work out the scale of the plot. (add=TRUE tells it to use the existing scale, among other things.)

Duncan Murdoch


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


Wesley

______________________________________________
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.

______________________________________________
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