[R] 3d scatter plot with both error bars and a flexibly fitted surface

Dieter Menne dieter.menne at menne-biomed.de
Fri Jan 23 16:54:09 CET 2009


Sean Zhang <seanecon <at> gmail.com> writes:

>  I, an entry level R user, wonder how make a 3d scatter plot with both error
> bars and a flexibly fitted surface.

For regular grid data, I found interp.loess in package tpg easiest to use to
compute the fine grid required for the plot.

For irregular data, check package akima and the chapter on spatial statistics in
MASS (Venables/Ripley).

For plotting, nothing beats surface3d in package rgl, but you will have to do
some additional work. Try 

library(rgl)
demo(abundance) 

for something that comes close to your requirements.


Dieter




More information about the R-help mailing list