Different Methods for Representing Data on an XY Graph

Updated Sep 18, 2018

Reported In

Software

  • LabVIEW Full

Programming Language

  • LabVIEW G

Issue Details

I want to write and update my XY graph, what are the different methods to do this?
I want to plot two Waveforms on an XY graph using NXG, one waveform is the X axis and the other is the Y axis.
 

Solution

There are several strategies to accomplish this. Generally, a Waveform Chart or Graph can be used to display continuous data; however if you would like to use the XY graph, the goal is to get your data into the same format. The required data format can be seen through context help by pressing Ctrl-H, and hovering your mouse over the input terminal of the XY graph.
 

Shown below are four different strategies for displaying the data.
 
  • Collect all the data into a single array using a For Loop and display the data on the XY graph in a single snapshot.

  • Save the information into an array that continuously updates, and continuously refresh the XY display.

  • Represent each XY data point in a cluster. Then, create an array of these clusters to represent an entire data set. This method makes it possible to display multiple data sets on a single XY graph.
     

Use a case statement in the while loop so that you can update the arrays of information in the same while loop, but at separate points in time.This method makes it possible to plot multiple data sets on a single XY graph, but at separate times.
 

 

If you want to plot two Waveform on an X-Y graph using NXG you can do it as shown in the Snippet below.

  • Firstly the two Sin Waveform functions generates two Sin waves, then the Waveform properties function gets the Y values of these waves and put them in a 1 dimensional array, the build cluster function will then create a cluster of these two arrays, the first array includes the X values and the second one includes the Y values.

WAS THIS ARTICLE HELPFUL?

Not Helpful