LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I graph muliple sets of y-values against a single set of x-values?

Hi.  I am trying to write a VI that will take columns of data stored in a 2D array and plot it with the first column being the x-coordinates and all subsequent columns (different parameters) of data being y-coordinates.  The number of these parameters is determined by the user, but it could be as high as 128.  I think that I need to write a for loop that will pair each column of y-coordinates with  the column of x-coordinates in a cluster, and then create an array of clusters to be plotted with an xy graph, but I am not sure how to do this. 
 
Also, it would be nice if each parameters could be its own color so they can be distinguished on the graph (each parameter is over 40,000 data points)
 
Thank you in advance!
 
-Pushrod
0 Kudos
Message 1 of 2
(2,245 Views)
What have you tried so far? A for-loop is a good way to do this since you have so many columns, and you can automatically have it create the array of clusters necessary for the XY graph. Basically you just need to index out the first column to get your X values, and then drive a for-loop for the number of Y values. You can determine this by simply using Array Size on the 2D array. It will return to you the number of rows and the number of columns. The coloring of each trace is automatic. One solution:

0 Kudos
Message 2 of 2
(2,235 Views)