[R] Matrix 3d plot

петрович bistanz at gmail.com
Tue Jul 5 19:36:57 CEST 2011


I have a problem with a 3d plot, suppose we have a matrix like this:

                   v1        v2       v3      v4
jan-2010     0.5     0.25    0.25    0.3
feb-2010     0.35   0.12   0.12    0.4
mar-2010    0.15    0.25    0.25  0.1

and i want to plot this matrix in 3d plot where x-axis is the first
column of the matrix above, y - axis is the first row of the matrix
above and the z-axis is the numbers corresponding, so
z(jan-2010,v3)=0.25

I was trying with persp() but i see that in this function z is a
vector but in my case is a matrix, so i receive an error message
I think this sound no so hard, but actually i couldn´t find a function
doing this, is there actually such a function?
Christian



More information about the R-help mailing list