Sample 24907: Add a 45-degree reference line to PROC GPLOT output
This sample program uses the Annotate facility to add a 45-degree reference line to PROC GPLOT output.
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.
This sample program uses the Annotate facilty to add a 45-degree reference line to PROC GPLOT output.
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 X Y;
datalines;
1 30
2 15
3 40
4 80
5 35
6 40
7 85
8 75
9 55
10 30
;
run;
/* Create an annotate data set that draws a */
/* reference line at a 45 degree angle. */
data anno;
function='move';
xsys='1'; ysys='1';
x=0; y=0;
output;
function='draw';
xsys='1'; ysys='1';
color='vibg';
x=100; y=100;
output;
run;
symbol1 i=none v=dot c=black h=1.3;
axis1 minor=none offset=(4pct,4pct);
title1 'Add a 45 degree reference line to PROC GPLOT output';
footnote1 angle=90 ' ';
footnote2 angle=-90 ' ';
/* Create the graph using the ANNO= option */
/* on the PLOT statement of PROC GPLOT. */
proc gplot data=a;
plot y*x / anno=anno haxis=axis1 vaxis=axis1;
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.
This sample program uses the Annotate facility to add a 45-degree reference line to PROC GPLOT output.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> GPLOT Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Annotation
|
Date Modified: | 2005-08-31 03:03:09 |
Date Created: | 2004-11-11 11:07:58 |
Operating System and Release Information
SAS System | SAS/GRAPH | All | n/a | n/a |