[R] 3D-plotting a 2D-matrix that contains z-values (3rd dimension)

Oliver oliver at first.in-berlin.de
Wed Jun 8 16:57:40 CEST 2011


Hello,

say I have a 2D-matrix (indexed by x and y), which contains
z values, which I want to plot over x-y.

Either dotted, or if possible as a landscape.

I tried around with persp and plot3d (from rgl)
and persp3d (from rgl).

I sometimes get something that looks good and a while later, when
trying some new data I need to worry about that again.

Is there something lika a convenience function that
can be used to feed the data into persp, rgl::plot3d and rgl::persp3d?

At least persp3d is picky about the order of the input data,
and I somehow always start again.

(plot3d seems to be most mathcing how I think).

Isn't that a very common case, where  my  z_x_y = mydata[x,y] ?

Maybe I just don't know the right function that helps me.

Any idea about that?


Ciao,
   Oliver



More information about the R-help mailing list