LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Hi, I am trying to get two plots to show up on an xy graph. It would be continually changing points and i would like to have the old points stay on the screen and just kind of scroll over for both plots. Here is how I have it hooked up right now, and it just has a straight line down the whole time.

The two points x and y coming from the matlab script node would just be the two Y-axis values and the I tried to connect the iteration terminal of the while loop as the x axis. But this is not working correctly.

0 Kudos
Message 1 of 20
(3,543 Views)

No code...

0 Kudos
Message 2 of 20
(3,538 Views)
haha Im sorry...here it is.
0 Kudos
Message 3 of 20
(3,532 Views)

PLEASE DO NOT POST BITMAPS TO THE FORUMS. There's a reason why bitmaps are not allowed, and that's because they're HUGE. Don't just change the extension to get it past the upload.

 

OK, now that that's out of the way....

 

The XY graph has no buffer. That means you have to create one.  You can either use the Express XY Graph and wire a False to the "Reset" input, or look at the "XY Chart" example that ships with LabVIEW that uses a subVI to implement the buffer. 

0 Kudos
Message 4 of 20
(3,523 Views)

Hi Bonesaw,

 

I think you need to build arrays of the data you want to display, not just the single points, then bundle the arrays and then build the bundled arrays in to a further array and connect to the graph. The .jpg shows how to display 4 plots, note the wires in to the separate bundles are arrays, not single data points. 

0 Kudos
Message 5 of 20
(3,520 Views)
The express xy works, but I want the two Y-axis inputs to be different colors. I dont know how I would do that because in order to use the express xy graph, I have to use a build array to combing the inputs.
0 Kudos
Message 6 of 20
(3,511 Views)

You can change the colors of the plots through the XY graph properties.

Right click on the graph on the front panel, go to the 'Plots' tab.

Then you can change the color, name, and type of plot.

Cory K
0 Kudos
Message 7 of 20
(3,482 Views)

Yea, but because I am using a build array,  it inputs the two Y-axis values as one input into the Y-value terminal. Therefore on the xy graph it only shows up as one plot

 

0 Kudos
Message 8 of 20
(3,475 Views)
Then you must not be wiring it up or building it up properly. Please upload your code.
0 Kudos
Message 9 of 20
(3,467 Views)
Here is the code. There's a lot in there. The xy graph part is at the top of the bottom while loop.
0 Kudos
Message 10 of 20
(3,462 Views)