Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Sep 6, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Run Sequence Plots and Scatter Plots

2 ratings | 2.50 out of 5
Print

Overview

Run sequence plots and scatter plots are typically the first plots you create in exploratory data analysis (EDA). These plots quickly show data in a visual format and allow you to detect errors and relationship patterns easily. You can use LabVIEW to create both run sequence plots and scatter plots.

Introduction to Run Sequence Plots and Scatter Plots

Most statistical analysis begins with displaying data in a run sequence plot. Run sequence plots are univariate plots because they show only one data set at a time. To create a run sequence plot, you plot the data in the order that you observe it. You primarily use the run sequence plot for determining the accuracy of recorded data. Data with no variation or extreme variation can indicate an improperly functioning data-recording device. If you determine that the data is invalid, you can stop collecting data.

The scatter plot is more sophisticated than and is a generalization of the run sequence plot. With run sequence plots, you plot data in the order that you observe it. With scatter plots, you display two sets of data against each other. You pair data points from each set to form an ordered pair (x, y) that you then plot. Scatter plots are multivariate plots because they present two data sets, or multivariate data. You can use scatter plots to determine if a mathematical relationship exists between the data sets. If you can express one data set in terms of another, then you need only one data set in the experiment, which saves time and reduces the cost of collecting data. For example, collecting the temperature and pressure of an automobile tire shows that as the temperature increases, the pressure exponentially increases. After you determine this relationship, you need to record only the tire pressure or the temperature in future tests because you can use the first data set to calculate the second set of data.

The scatter plot in the following figure shows a linear relationship between two data sets. You can observe this relationship because the cluster of points in the plot roughly appears to form a straight line. One data set rarely is an exact multiple of another so variations in the sets cause the line to be fuzzy or clouded. The important characteristic to note in scatter plots is the general shape, which can suggest what statistical model to use in future analysis.


In the following figure, the plot on the left shows that data array 1 has an exponential relationship with data array 2. Because this exponential relationship exists, you can use linear models to perform statistical analysis with data array 2 and the logarithm of data array 1. The plot on the right of the following figure shows a loose grouping of points. The grouping indicates that no relationship exists between the data sets.


As shown in the figure above, scatter plots allow you to see the relationships between data sets easily.

Creating Run Sequence Plots and Scatter Plots in LabVIEW


You can create both run sequence plots and scatter plots in LabVIEW. In most situations, you can use the waveform chart or the waveform graph to create a run sequence plot. The waveform graph accepts arrays and is suitable when you previously already have the data you want to plot. The waveform chart accepts one point at a time and is useful for displaying data as you record it. Refer to the Waveform Graph VI in the labview\examples\general\graphs\gengraph.llb for an example of using waveform graphs. Refer to the Charts VI in the labview\examples\general\graphs\charts.llb for an example of using waveform charts.

You also can create scatter plots in LabVIEW. The block diagram in the following figure shows how you can index two data arrays and build them into an array of ordered pairs. You can use the auto-indexing feature of the For Loop to expose each element of the data arrays. The bundle function forms a cluster containing each element, and you can build the cluster into an array. You then can pass the array to a waveform graph to display the data as a series of ordered pairs.


The default display of the waveform graph connects all data points with a line, but scatter plots display discrete (x, y) pairs. To create a scatter plot, right-click the plot legend and select Common Plots from the shortcut menu. Then select the scatter plot type, as shown in the figure below.


2 ratings | 2.50 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).