3d plotting

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

3d plotting

Levente
Dear all,


I'd like to plot a table that contains 3d data. The data in the table
is not square, i.e. the number of rows and columns are different.

I want the Z axis to represent the table values. However, when I start
my code, I get an error, that the length of X and Y and Z must be the
same.

Here is an outline of my data. The first row and the first column
shall correspond to X and Y axis.

file = '~/projects/Siemens_smartbox/Digital_input_cal/data_transp_1_1.csv'
#This is really a CSV file, but you have an idea how it looks like.

data = dlmread (file, ',')

x=meshgrid(data(1,2:28)')
y=meshgrid(data(2:7,1))
z=data(2:7,2:28)

plot3(x,y,z)


Is there any way to make octave to plot non rectangular shapes? Or
what I'm missing here?


Thanks for your help,
Levente


Reply | Threaded
Open this post in threaded view
|

Re: 3d plotting

BGreen
It's most helpful if you copy and paste the original error message.

I've never really used meshgrid or dlmread for any of my work, so this may be a useless suggestion... have you tried it without transposing the first argument x?
x=meshgrid(data(1,2:28))
y=meshgrid(data(2:7,1))
z=data(2:7,2:28)

- Brett Green


On Fri, Sep 13, 2019 at 9:27 AM Levente <[hidden email]> wrote:
Dear all,


I'd like to plot a table that contains 3d data. The data in the table
is not square, i.e. the number of rows and columns are different.

I want the Z axis to represent the table values. However, when I start
my code, I get an error, that the length of X and Y and Z must be the
same.

Here is an outline of my data. The first row and the first column
shall correspond to X and Y axis.

file = '~/projects/Siemens_smartbox/Digital_input_cal/data_transp_1_1.csv'
#This is really a CSV file, but you have an idea how it looks like.

data = dlmread (file, ',')

x=meshgrid(data(1,2:28)')
y=meshgrid(data(2:7,1))
z=data(2:7,2:28)

plot3(x,y,z)


Is there any way to make octave to plot non rectangular shapes? Or
what I'm missing here?


Thanks for your help,
Levente




Reply | Threaded
Open this post in threaded view
|

Re: 3d plotting

Levente
In reply to this post by Levente
On Fri, 13 Sep 2019 15:21:39 +0000
Carlo De Falco <[hidden email]> wrote:

> > Il giorno 13 set 2019, alle ore 15:27, Levente <[hidden email]>
> > ha scritto:
> >
> > x=meshgrid(data(1,2:28)')
> > y=meshgrid(data(2:7,1))  
>
> that is not the correct usage of meshgrid you should do
>
>   [x, y] = meshgrid (data(1,2:28)', data(2:7,1));

Dear Carlo,


Thank you very much for poiting this out. It does now work.


Levente
 


--
Levente Kovacs
Senior Electronic Engineer

W: http://levente.logonex.eu