LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can someone explain how to use the 3D surface graphs?

Hi,

 

I have a 2D data (X-Y) at several different values of Z. I want to display this using one of the 3D surface functions. However, I do not understand what should be the input - what is the matrix/vector in X, Y, Z? It is not coordinates or similar, and the examples were unclear as well. How should I convert my 2D data so as to be input to these functions?

 

Can anyone explain?

 

Thank you very much!

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 1 of 10
(3,102 Views)

 

 

I posted in this thread an example that illustrates how to use the 3d graph to do surfaces ac lines.

 

The type of data that you present to the 3d graph depends on which mthod you are using. In general you want to present a set of points that need plotted. These points are defined by taking one value for each of the XYZ and sometimes W arrays.

 

Explanation:

 

You want to plot a surface that is defined by four point (X0,Y0,Z0,W0), (X1,Y1,Z1,W1), etc. You can present the values using (4) 2-d arrays each of which have four values at index (o,o), (0,1), (1,0) and (1,1).

 

Thie first point plotted would be the point that is defined by taking (0,0) from each of the arrays.

 

So as you can see from the above all of your arrays should be of the same size and dimensions for this to work.

 

Look at the Example i posted in the other thread and try some small experiments with small data sets before you jump to anything complicated.

 

I hope that helps,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 10
(3,081 Views)

Hi Ben,

 

I'm sorry, but I  saw your example and I still didn't understand. I also didn't understand the sentence

"You want to plot a surface that is defined by four point (X0,Y0,Z0,W0), (X1,Y1,Z1,W1), etc. You can present the values using (4) 2-d arrays each of which have four values at index (o,o), (0,1), (1,0) and (1,1)."

 

The type of data I have needs 1 3D array, with indices X,Y,Z and value W. I understand how I can represent X,Y, and Z as 2D arrays (the coordinates themeselves) but W would still need to be 3D at least. How can W be 2D?

 

I would like to show a number of X-Y planes together at their respective Z heights, like in Matlab (no connection between the difernet planes yet). Is this possible using Labview 3D graphs? Is this possible using Labview at all?

 

Thanks,

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 3 of 10
(3,028 Views)

Hi Danielle:

 

Take a look at this KnowledgeBase article.  I think it might make a little more sense for the current organization of your data.

 

The example can probably be cleaned up a bit, so I'll try to get to that later and post the updated code.

Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 4 of 10
(2,980 Views)

Hi Danielle,

 

Take a look at this simpler example that lets you explore what the various values presented to the 3d graph do.

 

One you understand a single plot then take the step to multiple plots.

 

If you are still stuck please post your code (with DATA!) and tell us where you run into trouble.

 

Have fun!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 10
(2,952 Views)

Hi all,

 

Thank you very much for your suggestions.

 

What Alex suggested looks very much like what we want to display. Is it possible to view slices of this (for example a 2D slice in the Z-X plane)? Also, is there a way to make only part of the information transparent (for example, much of our data is black background. Is it possible to make this background transparent?)

 

Ben, your example looked great as well, but we could not open it as we have LV 8.5. Do you have an LV 8.5 or lower version of this or is it only possible form LV 8.6 and onward?

 

Thank you all for your help,

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 6 of 10
(2,843 Views)

Hi Danielle:

 

I am really not sure if that will be possible or not, at least with the ActiveX 3D Graph.  I will take a look at it over the weekend and update you with any progress I make.

 

Also, if you're interested I cleaned up the code from the KnowledgeBase Article and posted it to NI Community.  I think it's a bit clearer as to how you can plot multiple graphs.

Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 7 of 10
(2,811 Views)

I found that if you set your value to NaN (not a number) the graph will not display anything.  That's the best way I can find to set some points as "transparent." 

 

To see a cutout of the X-Z plane, I think you will have to use a different graph.  When you only have points in the X-Z plane or Y-Z plane, they show up as dots but are not connected and therefore not visible unless you are moving the graph around.  If you need to see something like this, I suggest using a different graph viewer.

Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 8 of 10
(2,768 Views)

A Person wrote:

...

 

To see a cutout of the X-Z plane,...


Use the project onto the X-Z plane.

 

Just rearrange the arrays so they are 2-d arrays in the X-Z plane.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 9 of 10
(2,762 Views)

Thanks, Ben!  Some array manipulation did the trick.  Let us know if you need any help with it, Danielle.

 

Also, I put the wrong link to the NI Community example above.  The correct example can be found here.

Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 10 of 10
(2,736 Views)