LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I plot multiple curves using the XY graph?

Your graph is only showing the last point(s) because that's all you're feeding it.  Just because you build a single point into an array doesn't make the array bigger.  Now it's an array with one data point rather than a scalar.  To the graph there's no difference.  What you want to do is to expand those build arrays and concatenate the new data into arrays coming from a shift register.  That way you have a history building up that gets plotted each iteration.

XY.PNG

 

EDIT:  Be aware that concatenating into an array like this is memory inefficient.  There's not much choice when you have unknown amounts of data coming in but it's something to be aware of.  If a VI like this runs for long periods you may run out of memory because of the copies LabVIEW will make in the name of data security.  There are numerous threads on the subject.  Search for more info...

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
Message 11 of 33
(17,314 Views)

Thank you for the reply. Shortly after posting I decided to switch to a different architecture entirely.  The help section on this topic could use a facelift, thank goodness for the forums.

 

Regards,

PChemist

0 Kudos
Message 12 of 33
(17,292 Views)

Dear All,

 

I am trying to plot three response trends from the output of a Simulation on one single XY Graph (see attached vi in the "All combined" case selection.  I have tried a variety of methods including those shown in the help files and example files however it simply doesn't work (the old chestnut of signal mismatches which drives me mad!!!).  I'm sure it can be achieved and I'm hopefully waiting for someone with more experience to point me in the right direction.

Attached vi for info.

 

Regards,

 

0 Kudos
Message 13 of 33
(17,065 Views)

Sorry, I am not familiar with the simulation toolkit, but tthere are a couple of things that don't make sense.

 

Why is there a FOR loop with 1 iteration and autoindexing outputs? That adds another dimension to your plot data without adding new data. remove it!

 

Each wire data seems to be a cluster of x and y arrays, directly compatible with an xy graph. To create an xy multiplot with all three, simply form an array fo these clusters.

 

 

 

0 Kudos
Message 14 of 33
(17,057 Views)

Hello,

 

I don't understand why you are using a for loop with one iteration. Just collect the signals you want to display into an array and use either the simulation time waveform or the collector with an XY graph.

 

Hope this helps.

 

 

vector graph.png

0 Kudos
Message 15 of 33
(17,053 Views)

Hi everybody,

i have read the articles but i didn t find my answer. in my case i have two separate graph but i want only one with 2 curves. i tried to build an array or for loop but nothing do it.

so in the attachment file i show you the graph 2 & 3 are the one i have and i would like to have the graph 4 with 2 curves.

i tried many things and now i don´t have more idea so i am calling help to you 🙂

thank you very much

0 Kudos
Message 16 of 33
(16,880 Views)

It looks like the problem is in your cluster to graph sub-vi.

I have replicated your code here (creating dummy xy data in the for loops). Notice the difference in the thickness of the pink lines when compared to the images you posted. Without seeing your code, I am guessing that you have overcomplicated the data formatting in the sub-vi.

 

 

combining plots.png

0 Kudos
Message 17 of 33
(16,875 Views)

I use the cluster to graph sub VI for the graph 2 and 3 but not for the 4. but i show you the subVI if you want first file.

And i tried the attachment file 2, and i see the values of X and Y axis change i see the graph "running" but not the line .


i know i could be hard to understand and i am sorry about it


Download All
0 Kudos
Message 18 of 33
(16,872 Views)

Sorry - I don't have the ability to open your vi. If you can 'save as previous version' to V8.5 I can take a look.

 

Ian

0 Kudos
Message 19 of 33
(16,868 Views)

i think is the easier sub vi we can do Smiley Happy

0 Kudos
Message 20 of 33
(16,868 Views)