![]() Chapter Contents |
![]() Previous |
![]() Next |
| SAS/GRAPH Software: Reference |
AXIS statement options:
| |||||||||||||
FOOTNOTE statement option:
| |||||||||||||
SYMBOL statement options:
| |||||||||||||
GOPTIONS
statement options:
|
Sample library member: GR08N01
This example uses SAS datetime values with an AXIS statement's ORDER= option to set the major tick marks on the horizontal axis. It adjusts the position of the first and last major tick marks.
The example also uses HILOCTJ interpolation in a SYMBOL statement to join minimum and maximum values. The default unit specification for heights in the graph are percent of the graphics output area as specified by GUNIT= in the GOPTIONS statement. The GOPTIONS statement also specifies the default fonts for TITLE1 and for other text.
Set the graphics environment. GUNIT= specifies the units in percent of the graphics output area. HTITLE= specifies the height for TITLE1 text. HTEXT= specifies the height for all other text. FTITLE= specifies SWISSB as the font for TITLE1.
goptions reset=global gunit=pct border
cback=white
colors=(black blue green red)
ftitle=swissb ftext=swiss htitle=6
htext=4;
Create the data set. DOWHLC contains the high, low, and close values of the Dow Jones Industrial index for each business day for a month.
data dowhlc;
input date date9. high low close;
format date date9.;
datalines;
02JAN1997 6511.38 6318.96 6442.49
03JAN1997 6586.42 6437.10 6544.09
...more data lines...
30JAN1997 6621.82 6481.75 6600.66
31JAN1997 6621.82 6481.75 6600.66
;
Prepare the data for a high-low plot. DOWHLC2 generates three records for each date, storing each date's high, low, and close values in variable DOW.
data dowhlc2; set dowhlc; drop high low close; dow=high; output; dow=low; output; dow=close; output;
Define titles and footnote. HEIGHT=3 in the FOOTNOTE statement overrides the height specified by HTEXT= in the GOPTIONS statement.
title1 'Dow Jones High-Low-Close'; title2 'January, 1997'; footnote height=3 justify=right 'GR08N01 ' ;
Define symbol characteristics. INTERPOL=HILOCTJ specifies that the minimum and maximum values of DOW are joined by a vertical line with a horizontal tick mark at each end. The close values are joined by straight lines. CV= colors the vertical lines, and CI= colors the line that joins the close values. WIDTH= controls the thickness of the line that joins the close points.
symbol interpol=hiloctj
cv=blue
ci=red
width=2;
Define characteristics of the horizontal axis. ORDER= uses a SAS date value to set the major tick marks. OFFSET= moves the first and last tick marks to make room for the tick mark value. COLOR= makes all axis elements red. MAJOR= and MINOR= modify the size and color of the major and minor tick marks.
axis1 order=('30DEC96'd to '03FEB97'd by week)
offset=(3,3)
color=blue
label=none
major=(height=3 width=2)
minor=(number=6 color=red height=2 width=1)
width=3;
Define characteristics of the vertical axis. LABEL=NONE suppresses the AXIS label. The COLOR= suboption in MINOR= overrides the COLOR= option.
axis2 color=blue
label=none
major=(height=3)
minor=(number=4 color=red height=1)
offset=(2,2);
Generate the plot and assign AXIS definitions. HAXIS= assigns AXIS1 to the horizontal axis, and VAXIS= assigns AXIS2 to the vertical axis.
proc gplot data=dowhlc2;
plot dow*date / haxis=axis1
vaxis=axis2;
run;
quit;
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.