Chapter Contents

Previous

Next
The PLOT Procedure

Overview

The PLOT procedure plots the values of two variables for each observation in an input SAS data set. The coordinates of each point on the plot correspond to the two variables' values in one or more observations of the input data set.

A Simple Plot is a simple plot of the high values of the Dow Jones Industrial Average (DJIA) between 1954 and 1994. PROC PLOT determines the plotting symbol and the scales for the axes. These are the statements that produce the output:

options nodate pageno=1 linesize=64 
   pagesize=25;

proc plot data=djia;
   plot high*year;
   title 'High Values of the Dow Jones'; 
   title2 'Industrial Average';
   title3 'from 1954 to 1994';
run;

A Simple Plot
[HTML Output]  [Listing Output]

You can also overlay two plots, as shown in Plotting Two Sets of Values at Once . One plot shows the high values of the DJIA; the other plot shows the low values. The plot also shows that you can specify plotting symbols and put a box around a plot. The statements that produce Plotting Two Sets of Values at Once are shown in Overlaying Two Plots .

Plotting Two Sets of Values at Once
[HTML Output]  [Listing Output]

PROC PLOT can also label points on a plot with the values of a variable, as shown in Labeling Points on a Plot . The data plotted represent population density and crime rates for selected U.S. states. The SAS code that produces Labeling Points on a Plot is shown in Adjusting Labels on a Plot with the PLACEMENT= Option .

Labeling Points on a Plot
[HTML Output]  [Listing Output]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.