LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

drawing points on an image

Solved!
Go to solution

Hi everyone.

i hope you all doing well and happy new year.

 

im having maltab program that calculates for me the CCT for some mixture of light intensities. when i run matlab i get list of 32 CCT points.

i managed to get the values from matlab to lab view and stor it in control box. now i want to draw them over this graph on the line you see that is marked in the middle of the colored area. i want to draw these points one by one with different colors and keep the previous points on the graph as well.

please help me out and its urgent

thanks

 

 

0 Kudos
Message 1 of 8
(3,141 Views)

First, I would highly recommend you run through the online LabVIEW tutorials, if you have not already done so.

 

Your problem is fairly easily solved using an XY graph.  Do the following:

 

  1. Drop your chromaticity diagram on the front panel as an image.
  2. Place an XY graph on top of it, scaled correctly, then make the XY graph background transparent so you can see the chromaticity diagram through it.  Alternately, you can put the chromaticity diagram as a background to the XY graph.
  3. Plot your two sets of points as two separate traces.  You can then change the color, point style, line style, etc of each trace separately.  Consult the LabVIEW help for examples of how to plot multiple traces to XY graphs.

Good luck!

 

0 Kudos
Message 2 of 8
(3,118 Views)

Hi, thanks for the reply

im new on labview, im really suffering hahah.

i just need your help in how to scale the xy graph coordinates to fit that available on the color space diagram?

 

thanks

0 Kudos
Message 3 of 8
(3,116 Views)

You can make the size correct by dragging the outline of the XY graph around until it neatly surrounds the chromaticity chart.  The axes values of the XY graph can be set by double clicking on the values (usually the start and end ones) on an axis and entering new values.  Alternately, you can right click the graph and choose properties, then directly enter the values there.  You can also use a property node to dynamically set them, but you should not need to do that.

0 Kudos
Message 4 of 8
(3,093 Views)

thanks for helping me out, i have done that.

now im stuck in puting the points on the graph

the results that im going to obtail, i mean the x and y values are going to be writen in array form, i managed to use index array to extract them out, now how to use them to make point on the graph and keep all the points on the graph even when the points get updated?



thanks in advance.

 

0 Kudos
Message 5 of 8
(3,088 Views)

Every time you write data to an XY graph, it clears the graph and writes only the data you give it.  Every time you write data to the graph, you need to write all the data you want on the graph.  This will require you to cache old data so you can rewrite it.  Use a shift register in your loop to do this.

0 Kudos
Message 6 of 8
(3,070 Views)

oh that sounds hard!

what if i just want to locate one point on the xy graph? the point coordinates will be available in array, is there any way i can use array index to draw these points on x,y graph?

0 Kudos
Message 7 of 8
(3,062 Views)
Solution
Accepted by arabic

Caching data in a shift register is actually fairly easy, it just sounds hard.  Indexing a single point and graphing it is similar.  The exact details of how you do it depends upon how your data is stored.  The XY graph will accept data in three formats:

 

  1. A cluster containing an array of X values and an array of Y values
  2. An array in which each element is a cluster of an X and Y value
  3. An array of complex numbers - the real part is plotted on the X axis, the imaginary part on the Y.

Options 1 or 2 would be best for your application.  I don't know what format your data is actually in.  If you have an array of X values and an array of Y values, option 1 is best.  If you have an array of XY value pair clusters, option 2 is good.  Let's look at option 1 first.

 

To display a single point, use Index Array on your X and Y value arrays to get a single point from each.  Use Build Array to convert each single point into an array (which still has just a single point).    You will have to collapse Build Array so it just has a single input.  Use Bundle to create a cluster from your two arrays.  Wire this to the XY graph.

 

For option 2, index out your points as in option 1.  Use Bundle to create a cluster from them.  Use Build Array to create an array of clusters from the cluster.  Wire this to the XY graph.

 

Good luck.

 

Message 8 of 8
(3,046 Views)