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

2011-06-09 Thread oliver
On Thu, Jun 09, 2011 at 01:50:17PM +0200, Uwe Ligges wrote: > > > On 09.06.2011 13:37, oliver wrote: > >On Thu, Jun 09, 2011 at 11:22:54AM +0200, Uwe Ligges wrote: > >>Well, > >> > >>persp(x, y, z) does exactly what you asked for: it plots tha matrix > >>z along the values given by the vectors x

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

2011-06-09 Thread Uwe Ligges
On 09.06.2011 13:37, oliver wrote: On Thu, Jun 09, 2011 at 11:22:54AM +0200, Uwe Ligges wrote: Well, persp(x, y, z) does exactly what you asked for: it plots tha matrix z along the values given by the vectors x and y. But I don't have these vectors x and y, so I have to create them just to

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

2011-06-09 Thread oliver
On Thu, Jun 09, 2011 at 11:22:54AM +0200, Uwe Ligges wrote: > Well, > > persp(x, y, z) does exactly what you asked for: it plots tha matrix > z along the values given by the vectors x and y. But I don't have these vectors x and y, so I have to create them just to call persp(). And persp also need

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

2011-06-09 Thread Uwe Ligges
Well, persp(x, y, z) does exactly what you asked for: it plots tha matrix z along the values given by the vectors x and y. If you need to calculate z values from x and y using some function foo, outer(x, y, foo) is typically your friend. Uwe Ligges On 08.06.2011 16:57, Oliver wrote: Hel

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

2011-06-08 Thread Oliver
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 try