LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get two plots to show up on an xy graph?

Something is very weird in your program Smiley Surprised
You wire the "i" to the X connector of both bundle and then "X" result to the "Y" connector of the first plot and "Y" result to the "Y" connector of the second plot?!? Is this normal?

I mean, I would expect X and Y data from the formula node to form one XY data point.
Now you can use a normal graph since your X-axis is 0, 1, 2, 3, .....

 


XY graphs can be build up in two different ways:

a) 1 cluster containig 1 array for X data and 1 array for Y data. You can use this lay out when you get several, or all points, at one time or if you display the graph once you collected all the data.

 

b) 1 array of clusters, each cluster contains 1 X data point and 1 Y data point. You can use this lay out when you get one data point at a time and you want to display them immediately, not waiting to have them all.

 

I think the way you get XY data points fits the second way of working, so in the attached screenshot you can see that I make clusters of XY data and build them together using Build array and a shift register.

 

Or did I missed something Smiley Sad

0 Kudos
Message 11 of 20
(1,566 Views)

Alain, you can plot the data as it is coming in, regardless of whether or not that is all of the data.

You can just build all the the x data into a 1D array, and the y data into another 1D array.

You can then cluster these arrays, where each cluster would be a plot.

 

You could just use the shift register to add the new points to each of the arrays.

XY plots.PNG

This code would result in two plots being displayed.

The first plot would be the 1D array of X1 vs the 1D array of Y1.

The same holds for X2 vs Y2.

Message Edited by Cory K on 07-24-2009 02:04 PM
Cory K
0 Kudos
Message 12 of 20
(1,562 Views)
Dont look at that X and Y coming out of the script node as X and Y for the graph. Thos could be called Y1 and Y2 and then the iteration is the X value. Therefore you would have (X,Y1) and (X,Y2) points. The program works fine except tehre is no differentiating between the two plots are showing up as one on the XY graph. I just need to change the colors so I can differentiate them.
0 Kudos
Message 13 of 20
(1,559 Views)

What you build there Cory is type a, in my description, of XY graphs setup.

Since his code generates one point at the time I would choose setup b.

 

But since the X-axis is 0, 1, 2, 3, and so on he doesn't need an XY graph in the first place!!!

He better use a chart, with buffer, to store his data.

0 Kudos
Message 14 of 20
(1,557 Views)

Ok then Y1, Y2 whatever Smiley Very Happy

 

But then as I already said forget the XY graph and use a chart, that will buffer some datapoints for you.

See attached screenshots.

Message Edited by Alain S on 07-24-2009 09:11 PM
Download All
0 Kudos
Message 15 of 20
(1,552 Views)
Ok, what is the value on the X-axis then. And I did it and its still showing up as one plot. But I am confused on the value of the X-axis. Is it time in seconds? But why is it showing up as one plot?
0 Kudos
Message 16 of 20
(1,531 Views)

Look at the Charts.VI example in the example finder.

 

You want to bundle those 2 points together into a cluster, not build them into an array.

0 Kudos
Message 17 of 20
(1,529 Views)
I just dont understand what the X-axis is. Is it time in seconds?
0 Kudos
Message 18 of 20
(1,523 Views)
It is just sample number on a waveform chart or waveform graph.  Since waveforms are a function of time, the chart/graph has a default axis title of Time (seconds).  You can change that if you want it to mean something else.  If it is based on time, but let's say 10 samples per second, you can set the dt of any waveform coming in, or set the multiplier in the scaling factor of that axis.
0 Kudos
Message 19 of 20
(1,510 Views)

Sorry for the confusion, you need to bundle the 2 datapoints together instead of building an array, Ravens Fan already told yo that. Shame on me 😞

 

Regarding the X-axis, it's just a succession of data points 0, 1, 2, 3 and so on.
What do they represent? You should know better than us.
I mean every time you press the "Measure Spot Size" you go through that part of the code. So is that for every picture, then your x-axis is "Picture".
Is it for every ROI in one pictue, then your x-axis is "ROI/Picture".

0 Kudos
Message 20 of 20
(1,494 Views)