Re: [R] Plotting 3d data?

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Mon, 16 Jun 2008 18:38:18 -0400

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



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 - 22:47:46 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 Wed 18 Jun 2008 - 02:31:46 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