# LabVIEW

cancel
Showing results for
Did you mean:

## 3d plot tutorial - Step 1

I see a lot of material in the forums, however I get lost very quickly.  I cant seem to identify where square one is.

What I am trying to do

I have an intern currently gathering lots of data that has four dimmensions.  He is moving a magnet in 3-D space around a single point.  He then records a reading that reflects the effect of the Magnet on that point.  So as I move around In 3D space I want to be able to interpret what the readings were at that point.

My Idea is to plot in 3D space all the positions he took magnetic readings and then color the dot based on a reading.  I figure I would only need 5 to 10 colors to interpret the data.

Question:

How do I do that?  There is a good post by Ben that illustrates how to graph 4-D data in this manner

http://forums.ni.com/t5/LabVIEW/Multiple-polar-plots-into-a-3d-plot/m-p/269435?jump=true

However,  I cant figure out where to start.  I go to look for the 3D graph to place on the front panel, but where I am placing an Indicator with an assitant subvi on the block diagram, he is placing a Control.

VS

How do I place that on the front panel? I suppose I could just copy it from the help file, but that doesnt aid me into understanding what is going on.

Where do I go to get basic information on how to understand and accomplish my task?     I figure you guys can help me with step 1, using some of the other information around I can finish the task.

I looked up in a book where to start and I quote "  3D graphs can be more complicated than the simple charts and graphs you've worked with -- they are really an advanced topic, so we won't say more about them here; "  No kidding?!  To add insult to injury the help files are not very clear.    So I turn to the community.

Message 1 of 7
(8,091 Views)

## Re: 3d plot tutorial - Step 1

Leason 0

There is more than one type of 3d graph in LV. THe example code in the thread you linked was based on the CW 3D graph. It should still work but has not been given alot of attention and NI is trying to replace it with their new version based on the 3D picture that incorporate the OpenGL standard (check me on that standard!).

Leason 0.5

If you just have to get it done and don't care about supporting it into the future, cut-n-paste from my example. It should work (bug if 3d graph on tab page and 3d graph was showing when shutdown you get bleed thru from other pages).

If you want to master this stuff... start with my example just to get an idea of one way it was done. Then move to the new version.

I have limited experience on the new version but did test in while it was in beta (you don't know bad documentation until you try to take on the 3d graph implemented in LVOOP with NO documentation!). So yes the new stuff is LVOOP based so you have to learn a bit about LVOOP if you want to enhance the NI built-stuff.

Take a look at the NI examples and learn what you need and then write your own.

Leason 1

Well it depends, what are you trying to do, and where are you running into trouble (aside from the lame help)?

Ben

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

## Re: 3d plot tutorial - Step 1

I believe the new 3d graph is a version of an Xnode so when you drop the object from the FP, LV does the coding to get you started. If you cut-n-paste that stuff is skipped.

Ben

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

## Re: 3d plot tutorial - Step 1

Thanks,  I finally found the front panel icon.  On my system it was buried under the Classic Menu.

Classic --> Graphs --> Active X 3D Paremetric Graph.

However, you mention that Labview is moving to OpenGL and the Active X implementation is slowly being discouraged.  Did I understand that correctly?   Also, Lets say I want to learn the newer way of using OpenGL.   How do I go about that?

I have labview 2009 SP1.

Message 4 of 7
(8,066 Views)

## Re: 3d plot tutorial - Step 1

@Gruntboy50 wrote:

...

However, you mention that Labview is moving to OpenGL and the Active X implementation is slowly being discouraged.  Did I understand that correctly?   Also, Lets say I want to learn the newer way of using OpenGL.   How do I go about that?

I have labview 2009 SP1.

I have to confess that I do not know how to answer that Q other than telling you what approach I used.

I sat down in front of my PC with a case of beer while my wife and son were away for a long week end and just kept pounding away until something started to click.

The various examples I have posted to the "3d" related threads should give you some data to start with and samples of what it should look like.

If you post follow-ups I'll try to check in occationally. I need to master the new version as well but life has move on and those week-ends with a PC and beer have been replaced visits by the grandauhghter, I can on help others.

Take care,

Ben

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

## Re: 3d plot tutorial - Step 1

I had to chuckle as I went about it a similar way.   Bottle of Jack, and some Blues and just pounded out a solution.  I ended up using the newer controls so I could maintain support in the future.  I ended up settling on a solution were I binned my data into 5 groups and sorted it into 5 different plots.  I then just plotted everything to the same 3d scatter function.

It's dirty and a little jury rigged, but it gets the job done.

I posted my solution and some dummy data.

Its a learning process, and there are a lot of improvements I would love to make.  However, I will learn them as I go. For example,  I would like to insert a 3d object as a reference and then plot the data around it.   It would help improve legibility and give a sense of reference to management.  Lets face it, I know what it means, but I need something pointy hair boss friendly.   I would also like to create a legend that decodes the color map.   Additionaly, I would like to find a more efficient way of doing this task so I can scale it up.

I attached my solution with some dummy data.  My task deals with a colorized volume and not a surface, so it may be a little hard to read.

Message 6 of 7
(8,030 Views)

## Re: 3d plot tutorial - Step 1

@Gruntboy50 wrote:
...
It would help improve legibility and give a sense of reference to management.  Lets face it, I know what it means, but I need something pointy hair boss friendly.   I would also like to create a legend that decodes the color map.

Depending on how much you need to water down the results, a 2D plot might be a more intuitive option.  You can just use a two dimensional intensity plot to display three of the dimensions, then use a slider to view slices of the fourth dimension.  Here's a link to an example of this method:

Zach C.
Field Engineer
Greater Los Angeles

Message 7 of 7
(8,013 Views)