These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
The graphics output in the Results tab was produced using SASĀ® 9.2. Submitting the sample code with releases of SAS prior to SAS 9.2 might produce different results.
/* Set the graphics environment */
goptions reset=all cback=white border htitle=12pt htext=10pt;
/* Create a sample data set */
data a;
input Xvar Yvar;
datalines;
1 10
2 20
4 40
5 60
6 80
9 50
10 30
;
run;
/* Create an Annotate data set to draw the top axis */
data anno;
length function $ 8;
retain xsys '2' ysys '3' color 'black' when 'a';
do i=1 to 10 by .25;
if i/int(i)=1 then do;
tickhght=1.5;
text=left(put(i,2.));
end;
else do;
tickhght=0.8;
text='';
end;
function='move'; x=i; y=75; output;
function='draw'; x=i; y=75+tickhght; output;
function='label'; x=i; y=79; output;
end;
run;
symbol1 i=join f=marker v=U c=libg;
symbol2 i=none v=none c=libg;
axis1 origin=(15,15)pct minor=(n=4)
length=60 pct offset=(2,2);
axis2 origin=(75,15)pct minor=(n=4)
length=60 pct offset=(2,2);
axis3 origin=(15,15)pct minor=(n=3)
order=(1 to 10 by 1) length=60 pct offset=(2,2);
title1 'Sample plot with four axes';
/* Create the graph using the ANNO= */
/* option on the PLOT statement */
proc gplot data=a;
plot yvar*xvar / vaxis=axis1 haxis=axis3 frame anno=anno;
plot2 yvar*xvar / vaxis=axis2;
run;
quit;
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> GPLOT Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Annotation |
Date Modified: | 2005-08-31 03:03:15 |
Date Created: | 2004-11-11 11:08:00 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | SAS/GRAPH | All | n/a | n/a |