04-05-2016 08:00 AM
Hello,
How to plot multiple curves on XY graph.
Here is a solution for 2 curves, but if the number of curves is important (e.g. 10) this method becomes boring.
One more detail - all Y curves share the same X.
Thanks
Solved! Go to Solution.
04-05-2016 08:08 AM
This depends on the incomming data.
1. If they all share the same Y data then just wire it to the same Y array.
2. Ideally the X data is in a 2D array and you can do it in an autoindexing loop.
For each X set
bundle XY and autoindex out
Plot the answer as a multiXY plot
04-05-2016 08:27 AM
My first thought was to have the data be in a 2D array and then you can do all of the work in a FOR loop to create the cluster for each plot and the autoindex out to the XY Graph.
04-05-2016 08:37 AM
Well, to avoid confusing I define more exactly my setup (for simplicity for just 2 curves).
There are 3 arrays of size N: X, Y1, Y2.
Y1 and Y2 share the same X.
If I properly understood point (1), I build an array from Y1 and Y2 (using Build Array)
And this new array (let say YY) "unify" with X array (using Bundle).
Then Bundle output wire to XY graph.
Correct ?
04-05-2016 08:43 AM - edited 04-05-2016 08:43 AM
Maybe this will clarify what we are saying.
04-05-2016 08:51 AM
Yes !
It's exactly what I searched for.
07-19-2020 10:41 PM
Had a hard time following the above until writing out another description for the solution VI:
For non-uniform x-axis data, curves are generally represented as 1-D array X data and Y data pairs. A method for minimizing calls to shared X data is as follows:
If the X-axis data is shared, build a 2-D array out of the Y-axis 1-D arrays. Then use a For-Loop to index through the 2-D data, bundle it with the X data, and autoindex out the array of clusters to an XY Graph.