Chapter Contents

Previous

Next
The GPLOT Procedure

Example 5: Connecting Plot Data Points


Procedure features:
PLOT statement option:
CAXIS=
CTEXT
CVREF
HAXIS
HMINOR=
LVREF=
VAXIS=
VMINOR=
VREF
Other features:
SYMBOL statement
Sample library member: GR21N05

[IMAGE]

In this example, the PLOT statement uses a plot request of the type y-variable*x-variable to plot the variable HIGH against the variable YEAR to show the annual highs of the Dow Jones Industrial Average over several decades.

This example uses a SYMBOL statement to specify a plot symbol and connect data points with a straight line. In addition, the example shows how PLOT statement options can add reference lines and modify the axes (AXIS statements are not used).
 Note about code
libname reflib 'SAS-data-library';
goptions reset=global gunit=pct border cback=white
         colors=(black blue green red)
         ftitle=swissb ftext=swiss htitle=6 htext=4;
 Note about code
data reflib.stocks;
   input year @7  hdate date9. @15 high
              @24 ldate date9. @32 low;
   format hdate ldate date9.;
   datalines;
1955  30DEC55  488.40  17JAN55  388.20
1956  06APR56  521.05  23JAN56  462.35
...more data lines...
1994  31JAN94 3978.36  04APR94 3593.35
1995  13DEC95 5216.47  30JAN95 3832.08
;
 Note about code
title1 'Dow Jones Yearly Highs';
footnote1 h=3 j=l ' Source: 1997 World Almanac'
          j=r 'GR21N05 ';
 Note about code
symbol1 color=red
        interpol=join
        value=dot
        height=3;
 Note about code
proc gplot data=reflib.stocks;
   plot high*year / haxis=1955 to 1995 by 5
                    vaxis=0 to 6000 by 1000
                    hminor=3
                    vminor=1
 Note about code
                    vref=1000 3000 5000
                    lvref=2
                    cvref=blue
                    caxis=blue
                    ctext=red;
run;
quit;


Chapter Contents

Previous

Next

Top of Page

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