From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple curves on XY graph

Solved!
Go to solution

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

 

 

 

multiple_curves_on_XY_chart.png

0 Kudos
Message 1 of 7
(6,251 Views)

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

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 7
(6,249 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 7
(6,232 Views)

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 ?

 

 

0 Kudos
Message 4 of 7
(6,222 Views)
Solution
Accepted by topic author Pavel_47

Maybe this will clarify what we are saying.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 7
(6,214 Views)

Yes !

It's exactly what I searched for.

0 Kudos
Message 6 of 7
(6,200 Views)

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.

0 Kudos
Message 7 of 7
(4,127 Views)