SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Creating Plots
Creating a Basic Plot


Let's start by using the GPLOT procedure to plot one variable against another within a set of coordinate axes. You specify
  • a PROC GPLOT statement to invoke the procedure and identify the data set to be used
  • a PLOT statement to specify the variables to be plotted.

General form, simple PROC GPLOT step:
PROC GPLOT DATA=SAS-data-set;
        PLOT vertical-variable*horizontal-variable;
RUN;

where

  • SAS-data-set identifies the data set to be used
  • vertical-variable is the variable plotted on the vertical axis
  • horizontal-variable is the variable plotted on the horizontal axis.


In the PROC GPLOT step below, the PROC GPLOT statement invokes the procedure and names Clinic.Totals2000 as the data set that contains the variables to be plotted. The PLOT statement specifies NewAdmit as the vertical axis variable and Month as the horizontal axis variable.

     proc gplot data=clinic.totals2000;
        plot newadmit*month;
     run;
The graph below is the output from the PROC GPLOT step above. The entire graph appears in one default color, and the default plotting symbols (plus signs) are not connected.


Default PLOT output.


back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement