LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 Coordinates, 1 Data For Intensity Graph?

Greetings, I have 3 datas, two of them will be X and Y coordinates, and the last one will be my data When 3 datas come from my analog input I want plot a 2D intensity graph. Such as, first data is 3, second is 5 and third one is 9.

 

3 should be the X value, 5 should be the Y value and the 9 should be the intensity. So there will be the 9 value on (3,4) X-Y 2D array or graph. But I do not know how to do it like this. I hope I was clear. Can someone help me?

0 Kudos
Message 1 of 7
(5,355 Views)

The intensity graph displays the contents of a 2D array in the following manner: The row and column indexes are the coordinates along the axes.  The value in the array is the intensity.

 

For your example Z[3,5] = 9.  If your X and Y data can be non-integer values, you must perform a mapping transformation to get to the integers needed for the index.

 

Also, if your data is sparse, meaning that you do not have an intensity value for every location on the graph, you may need to experiment with the values used to intialize the array, because they will also be plotted.  Unlike other graphs where NaN values do not plot, every location in an intensity graph must have some value.

 

I recommend that you initialize an array with the number of elements matching the size of your intensity graph. Connect this array to a shift register.  Inside the loop use Replace Array Subset to put the data from your analog input into the array and display the result on the intensity graph.

 

Lynn

0 Kudos
Message 2 of 7
(5,346 Views)

Let me try to tell again, I have three arrays, first one should be the row number, second one should be the column number and the third one should be the data in my matrix. Because intensity graph works with 2D matrix.

 

For example;

first array:                1-1-1-2-2-2-3-3-3

second array:           1-2-3-3-2-1-1-2-3

 

third array:                8-8-9-8-8-8-9-8-9

 

I want a matrix like that:          8 8 9

                                             8 8 8

                                             9 8 9

                                           

I hope I was clear now.

0 Kudos
Message 3 of 7
(5,331 Views)

Initialize a 2D array of sufficuent size with zero, then, using a for loop with the array in a shift regsiter, autoindex over the three arrays, and using replace array subset with array 3 wired to the element and arrays 1 and 2 wired to the indices.

 

Of course if the two index arrays are nicely regular as in your case, a simple "reshape array" of the third array might be all you need.

 

Also, remember that in LabVIEW indices start with zero, so you should subtract 1 from the first two arrays.

0 Kudos
Message 4 of 7
(5,329 Views)

Try this (pick one!):

 

 

 

(As mentioned, if your first index is one instead of zero, subtract one from arrays 1 and 2)

 

Note that the upper version is only needed if the indices were scrambled.

Download All
0 Kudos
Message 5 of 7
(5,324 Views)

Can you send it for version 8.5 please?

0 Kudos
Message 6 of 7
(5,318 Views)
0 Kudos
Message 7 of 7
(5,302 Views)