LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to display 4d data within a 3d scatter plot

Gruntboy50,

Here are three pictures ( not snippets .. sorry ) showing the generation of the color look up table, the generation of the bins, placing the data into the 128 plots based on the bin values, plotting the 128 plots within one 3d plot, and then setting the color and point style for the 128 plots. Hope these clarify what I have done. ( I apologize for the spaghetti code approach, I am a Labview tyro )

 

As you will see, this was done in a very brute force way. The initial setting of the color and point style takes awhile even on a fast computer, likely because of the way I am setting the properties. Once the properties have been set once, it goes relatively quickly there after ( I don't modify the color properties unless the range has changed . Luckily I am trying to display a lot of data so no one expects the display update to be quick.

 

The formula node can be easily done graphically, i just find it easier to maintain the code.

 

Let me know if this helped.

 

-- Sam

Download All
Message 11 of 22
(4,502 Views)

Hi,

 

I am trying the same approach as Sam, but the problem is I have bins which contain one point and so don't show on the scatter plot. Is there a way to change this? I would also like a cursor which shows the x, y, z and w-value. Is this possible?

 

Best regards

 

KF

0 Kudos
Message 12 of 22
(3,991 Views)

Hi KF2, 

 

I don't understand what you mean by only having one data point per bin and it not showing up on a 3D Graph. As to your other question, I believe cursors are only able to display the X, Y and Z position of the data, not a 4th dimension. 

 

It may be best to post your question in a new thread with as much information as possible, as it is unlikely that anyone else will respond to a thread as old as this one. 

 

-N

National Instruments
Staff Certification Engineer
0 Kudos
Message 13 of 22
(3,968 Views)

Hi Nathanael,

 

I will start a new thread if I can't find an answer here. But the problem is: Sam had 1M datapoints he wanted to plot 4-dimensional. So he binned the data in 128 bins according to the W-value and assigned a color to each bin. Then he plots 128 3d-graphs on one plot.I am trying the same approach, but I have less data, so I have bins which contain one datapoint. So When I want to plot that one point it doesn't show up. I attached an example VI, a 3d plot with one datapoint. You can only see the datapoint if you are rotating the graph, but it dissapears when you don't rotate it. I can't make less bins also.

 

regards

 

KF

0 Kudos
Message 14 of 22
(3,966 Views)

Hey KF2,

 

I ran your VI and was able to see the data point when I was not rotating the graph.  It appeared as a square to me though when not rotating it.  I just changed the properties to make it appear as a solid circle so it looked the same when rotating the graph and when not rotating.

Jesse S.
Applications Engineer
National Instruments
0 Kudos
Message 15 of 22
(3,931 Views)

Hi Jesse,

 

That's strange, I still use Labview 2009, could it have something to do with this?

 

Best regards

 

KF

0 Kudos
Message 16 of 22
(3,925 Views)

frontpanel.jpg

 

 

let's test!

this is what the attached "untiteled-2009.vi" looks on my machine (2012)

 

Regards,
Alex

 

 

0 Kudos
Message 17 of 22
(3,913 Views)

the attached .vi is my implementation of sam roger's approach converted from 2012 to 2009

 

 

Works fine in 2011 and 2012!

 

 

 

0 Kudos
Message 18 of 22
(3,911 Views)

Hello,

 

 

Yes you're VI also runs nicely on my version. But  I am not sure if it adresses my problem. I don't think you have bins containing only one datapoint. I attached a version which also colors graphs according to the bin nr. If you run the VI, you see the graph is colored almost red, because most data is in the first bins. But some points come on bins further down the road. Usually they are the only datapoint in this bin. I can't see these points appearing on the graph. For instance if you go to bin 128 or row 127 in each dataset, you can see that the datapoint in this bin is (0,1,10) with a W-value of 17006,3. If I look at the graph without rotating I can't see the point. But when I rotate I see a blue point on that location. I also put a 3D-scatter plot on the side with only one datapoint where I see the same thing. So I am not sure if I am the only one seeing this, Fox sees the single datapoint apperently.

 

Best regards

 

KF

0 Kudos
Message 19 of 22
(3,908 Views)

In 2013-06-30_xyz_4d.vi the 4th dimension is a plane, which is projected on the xyz data; color is a function of the distance to the origin of that plane.

 

let's look on your "Untiteled.vi":

 

1# Kp ... x

2# Ki  ... y

3# Kd ... z

 

4# ?   ... w

 

Each point in xyz is meant to get it's unique color, right? So, there are as many "bins" as there are "points".

 

 

in your example there are 151 "points" (see analysis array) but you just got 128 bins and colors.

 

1) input:

Transpose your input arrays and you'll get 151 data points = 151 bins

 

2) colorramp:

Change the N of the color ramp generator from 32 to 64. Now you got 255 colors > 151

 

3) cosmetics:

- Set color ramp style to "custom"

- There are 6 values in "color ramp index" by default; so, build an 1d array with 6 times the same color and feed it to "color ramp array"

 

4) 3d scatter:

-Turn of the lights

- Disable quick draw

 

 

3d scatter.PNG

 

 

 

 

Regards,
Alex

 

0 Kudos
Message 20 of 22
(3,893 Views)