SAS/Graph: Hands On Session

Michael Friendly
Hands on Session

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.
  1. 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;
           
  2. 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.
  3. The programs LABELPT.SAS and LABELPT2.SAS show examples of labelling points in a scatter plot using the Annotate facility. Try one.
  4. 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.
  5. 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:

Hands-on Sesstion 2

Proc GREPLAY

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.
  1. A prepared example, PLOT2X2.SAS, uses PROC GREPLAY to present the 4 graphs of Anscombe's data in a single plot.
  2. 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;
           
  3. Try some of the following operations:
    1. Examine the GREPLAY help facility (Press PF1)
    2. Replay a graph or two by typing "S" in the Sel (SELECT) field.
    3. Examine the templates in the Template Catalog SASHELP.TEMPLT(1) (Press PF2).
    4. 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.
    5. 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.
-----------------------