SAS/Graph: Hands On Session
Michael Friendly
Hands on Session
A number of SAS/Graph demonstation programs are stored in the
directory
k:\home\sasuser\psy6120\graph.
You can access them from the File menu, chosing Open into Program
Manager, then navigating to that directory.
- Try the GDEMO program. It produces a welcome screen with PROC
GSLIDE, and has examples of each of the other main graphics
procedures stored as macros. To try the GPLOT example, type
%GPLOT;
- The program GPLOT5A.SAS shows an example of plotting bivariate
data with a regression line and confidence bands. Give it a
try, then examine the PROC GPLOT step in the Program Editor.
- The programs LABELPT.SAS and LABELPT2.SAS show examples of
labelling points in a scatter plot using the Annotate
facility. Try one.
- Make up your own GSLIDE Open the file
K:\home\sasuser\psy6120\graph\MYSLIDE.SAS into the Program
Editor, edit it to add some content to the TITLE, NOTE, etc
statements, and run the program.
- Maps The maps datasets that come with SAS/Graph are compressed
to save space and must be decompressed before use. Maps of
CANADA, the US, INDIA and a few others are now decompressed
on the Pavlov server. Try one or more of the following:
- ONTMAP.SAS - A map of southern Ontario, empty, with
county labels taken from the MAPS.CANCENS dataset.
- INDIAMAP - A map of India.
PROC GREPLAY can be used to compose a graph made up of one or more
separate SAS/GRAPH displays. The plots are arranged using
"templates", which can be done programmatically or
interactively. In this session we'll examine the template
facility.
- A prepared example, PLOT2X2.SAS, uses PROC GREPLAY to present
the 4 graphs of Anscombe's data in a single plot.
- Run several of the graphics programs listed above under Session
1 - GDEMO.SAS, for example. By default, graphs are stored
in a graphic catalog named WORK.GSEG.Type the following
lines into the Program Manager to bring up a display of the
graphs stored in WORK.GSEG:
Proc GREPLAY IGOUT=WORK.GSEG
TC=SASHELP.TEMPLT;
- Try some of the following operations:
- Examine the GREPLAY help facility (Press PF1)
- Replay a graph or two by typing "S" in the Sel
(SELECT) field.
- Examine the templates in the Template Catalog
SASHELP.TEMPLT(1) (Press
PF2).
- Once in the template catalog, display a template by
moving the cursor to the Sel field and press PF2
(DISPLAY). Press PF3 to return to the GREPLAY list
screen.
- Replay graphs in a template: In the GREPLAY list screen,
type the name of a template in the
"Template" field. E.g., you might type
U1D2, for a template with 3 sections (1 up, 2
down). Then type numbers (1, 2, 3, etc.) in the Sel
field to specify which plots are to appear in each
panel of the template.
-----------------------
(1) SASHELP.TEMPLT is part of SAS, so it it
always available.
-----------------------