Re: [R] Plotting 3d data?

From: Wesley Tansey <tansey_at_vt.edu>
Date: Mon, 16 Jun 2008 13:57:15 -0700

> 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



R-help_at_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. Received on Mon 16 Jun 2008 - 21:18:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 17 Jun 2008 - 00:30:59 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive