NC STATE University
SAS Consulting, Department of Statistics
UNIX SAS version 8.2

SAS Graph

Replay 4 graphs per page with the l2r2s template.

***greplay.sas;

**BUILD DATA SET;
data phos1;
input sbnum pre1-pre5 post1-post5;
diff1=post1-pre1;
diff2=post2-pre2;
diff3=post3-pre3;
diff4=post4-pre4;
diff5=post5-pre5;

cards;
10 5 2 3 4 3 4 3 4 3 2  
11 3 5 3 2 4 5 4 5 4 3  
12 5 4 5 3 4 5 3 4 3 4  
13 3 5 3 2 4 5 4 5 4 3  
14 3 5 3 2 4 5 4 5 4 3  
15 3 5 3 2 4 5 4 5 4 3  
16 3 5 3 2 4 5 4 5 4 3  
;
run;


***EMPTY GRAPHICS CATALOG;
proc greplay nofs igout=gseg;
delete _all_;
run;

***GENERATE 4 PLOTS;
goptions reset=all dev=xcolor nodisplay gsfmode=replace hsize=4.5in vsize=3.5in ftext=swissb;
symbol1 v=dot i=join c=black;
symbol2 v=circle  i=join c=black;
symbol3 v=diamond i=join c=black;
symbol4 v=star i=join c=black;

axis1 label=(a=90 h=1 'Difference 1') minor=(n=3);
axis2 label=(a=90 h=1 'Difference 2') minor=(n=3);
axis3 label=(a=90 h=1 'Difference 3') minor=(n=3);
axis4 label=(a=90 h=1 'Difference 4') minor=(n=3);

axis5 label=('Subject' h=1) minor=none;

title h=.5 '  '; **This creates a small border at top of graphs;

proc gplot gout=gseg ;
plot diff1*sbnum / name='graph1' vaxis=axis1 haxis=axis5;
plot diff2*sbnum / name='graph2' vaxis=axis2 haxis=axis5;
plot diff3*sbnum / name='graph3' vaxis=axis3 haxis=axis5;
plot diff4*sbnum / name='graph4' vaxis=axis4 haxis=axis5;
run; quit;



***PUT 4 to  A PAGE WITH GREPLAY;
*Choose one of the following goptions statements based on what you want to do;

***to view on screen;
goptions reset=all dev=xcolor display rotate=landscape hsize=9in vsize=7in
  vorigin=.5in horigin=.5in;


***to save to file you need a filename and goptions statement;
/*
filename plot1 'temp1.psl';
goptions gsfname=plot1 gsfmode=repalce dev=psl rotate=landscape
  hsize=9in vsize=7in vorigin=.5 horigin=.5;
*/

***to send to printer;
*goptions reset=all dev=sasprtg display rotate=landscape hsize=9in vsize=7in
    vorigin=.5in horigin=.5in;

proc greplay igout=gseg nofs;
tc=sashelp.templt;
template=l2r2s;
treplay 1:graph1 2:graph2 3:graph3 4:graph4;
quit;

[an error occurred while processing this directive]
Maintained by:Sandy Donaghy and Joy Smith
Last Modified: Wednesday, 25-Jun-2003 14:37:08 EDT
Filename: /working_groups/sas/samples/graph/template2.html