This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

# Plot XY Data from Arrays in LabVIEW

Updated Apr 24, 2024

## Environment

### Software

• LabVIEW
• I have some x-y data in a 2D array that I'd like to plot in LabVIEW. What do I need to do to plot my data?
• How can I create multiple Y axes on an XY Graph?
• Whenever I connect an array wire directly to an XY Graph, I get an error telling me that I've connected two terminals of different types.

### Plotting a 2D Array on an XY Graph

To plot X and Y data on an XY Graph, you must have an array of X data and Y data (either as separate arrays, or combined in a 2D array). These arrays must then be bundled into a Cluster.
The snippet below illustrates how to index the X and Y data from a 2D array and then bundle them into a Cluster.

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

2. Use the Index Array function to separate the array into two one-dimensional arrays -- one containing X data and one containing Y data.
3. Bundle the arrays into a Cluster. This is the expected input type of the XY Graph.

### Plotting Multiple Y Axes on an XY Graph

Each array of Y axis data must be bundled into a Cluster with its corresponding X axis array. Then, the Clusters (one for each Y axis) must be built into an array.
The snippet below illustrates how to plot 2 different Y axes on an XY Graph.

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.