NC STATE University
SAS Consulting, Department of Statistics
PC 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
;


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

***GENERATE 4 PLOTS;
goptions reset=all dev=win 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=win display rotate=landscape hsize=9in vsize=7in vorigin=1in horigin=1in ;


***to save to file you need a filename and goptions statement;
*filename graphout 'temp1.psl';
*goptions gsfname=graphout gsfmode=repalce dev=psl nodisplay rotate=portrait hsize=9in vsize=7in vorigin=1in horigin=1in  ;


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

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

Maintained by:Sandy Donaghy and Joy Smith
Last Modified:
Filename: