LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot 2 functions of different dimensions

Solved!
Go to solution

Hi guys,

 

For example, I have the vectors:

 

x1 = [2 4 6 8 10],   y1 = [4 7 8 9 4 ]

 

x2 = [ 1 2 3 4 5 6 7 8 9],   y2 = [ 2 4 5 6 7 5 8 8 7]

 

I want to plot (x1,y1), plot(x2,y2) on the same graph. Notice that the length of the two plots are different.

 

I tried to use the XY graph, but there is no way to do this, and the waveform graph, requires an inital value for x, and delta x, which are not the same in this case.

 

Thank you for any help.

 

0 Kudos
Message 1 of 4
(2,635 Views)
Solution
Accepted by topic author ade77

If you hover over the BD terminal of the XY graph it shows you how to get multiple plots, just build an array of individual XY plots.

 

SimpleXYGraph.png

Message 2 of 4
(2,617 Views)

Thanks Darin. You provided the solution.

 

 

 What confused me about the XY graph, was that when I placed in on the block diagram, the express build XY graph was attached with it, and when I hover on the XY graph, on the context help it was only showing the use of the express build XY graph.

0 Kudos
Message 3 of 4
(2,612 Views)

With a name like "Express XY Graph" it has to be good.  Allow me to list a few things I use more often than Express VIs:  local variables, global variables, stacked sequence structures.  Now that I think about it, I use Express VIs about as often as I use the Stop Function.

 

If you really wanted to see the glory of the "Express" version, you can create your Express XY Graph.  Copy the Helper VI, use build array to get an array of the output graphs and feed that to the graph.  As an added bonus you get lovely conversions of the data from array to dynamic data.  I feel guilty showing this, just remember, friends don't let friends do this:

 

ExpressXYGraph.png

Message 4 of 4
(2,607 Views)