Exploring Data in Two Dimensions

Example: Create a Line Plot from Multiple Y Variables

In this section you create a line plot of the co and wind variables versus the datetime variable of the Air data set. The co variable is a measurement of carbon monoxide. The wind variable is a measurement of wind speed. The datetime variable is the hour and date of each measurement.

To create a line plot:

  1. Open the Air data set.

  2. Select GraphLine Plot from the main menu, as shown in Figure 6.11.

    Figure 6.11: Selecting a Line Plot

    Selecting a Line Plot

    The Line Plot dialog box appears. (See Figure 6.12.)

  3. Select the co variable. Hold down the CTRL key and select the wind variable. Click Add Y.

  4. Select the variable datetime, and click Set X.

  5. Click OK.

    Figure 6.12: The Line Plot Dialog Box

    The Line Plot Dialog Box

    A line plot appears (Figure 6.13), which shows the carbon monoxide and wind measurements for each hour of a seven-day period. By default, the two lines are displayed in different colors. You can change the color and line style of the lines, as shown in the remainder of this example.

    Figure 6.13: A Line Plot

    A Line Plot

  6. Right-click near the center of the plot, and select Plot Area Properties from the pop-up menu.

    The Plot Area Properties dialog box appears. (See Figure 6.14.)

    Figure 6.14: Plot Area Properties for a Line Plot

    Plot Area Properties for a Line Plot

  7. Select wind in the Lines list.

  8. Change the line style to dashed and the color to blue.

  9. Click the large left arrow in the center of the dialog box to apply the changes to the wind line.

  10. Click OK.

    Figure 6.15: A Line Plot with Line Colors and Styles

    A Line Plot with Line Colors and Styles

    The line plot now looks like the plot in Figure 6.15. The carbon monoxide line shows periodic behavior for the first half of the week, followed by extremely low values for the second half of the week. The wind values are low for the first half of the week, but much stronger for the second half. These data might indicate that sufficiently strong winds can blow away carbon monoxide.

You can click any observation marker to select the observation. You can click while holding down the CTRL key to select multiple observations. You can draw a selection rectangle to select a group of observations. You can also select the lines themselves by clicking a line segment that is away from any observation. If you open the dialog box shown in Figure 6.14, selected lines in the line plot are also selected in the Lines list in the dialog box.

Note: If you plot multiple Y variables, then an observation in the data table is represented by multiple markers in the line plot. Clicking any marker in the plot selects the entire corresponding observation.