LabVIEW:Plotting Data

From OriginLab Wiki

Jump to: navigation, search

This example shows how to create a graph and plot worksheet data to it.

The block below is for creating a new project with a empty graph (OA_NewEmptyGraph), then create a new empty worksheet (OA_NewWorksheet). The Worksheet refnum is then used to call Origin COM property (Worksheet.Cols) to set the 2-column worksheet.

Image:Labview Example4_1.png

A FOR loop is then used to set both two Y columns (, and with Even Sampling ( so that we don't need X columns to make plots. Also it fills both columns with some sample data, in the form of Guassian peak.

Image:Labview Example4_2.png

The block below is for plotting(OA_PlotWksCols) the sample data into the graph layer created earlier and to get the GraphPage refnum to use invoke node to call the Activate method, so as to bring the graph to the front.

Image:Labview Example4_3.png