Sample 25503: Storing annotate graphics using PROC GANNO
This sample creates an Annotate data set that draws four colored squares, displays the data set as a single graphics output, and stores the output as a catalog entry in a permanent graphics catalog.
Before submitting the sample code, modify the LIBNAME statement that defines the libref of GRAFCAT so that it points to an existing directory. The code writes a permanent graph catalog to this directory (so you must have update access to this directory).
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 creates an Annotate data set that draws four colored squares, displays the data set as a single graphics output, and stores the output as a catalog entry in a permanent graphics catalog.
Before submitting the sample code, modify the LIBNAME statement that defines the libref of GRAFCAT so that it points to an existing directory. The code writes a permanent graph catalog to this directory (so you must have update access to this directory).
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 the Annotate data set */
data squares;
length function color $ 8 text $ 25 style $ 25;
xsys='3'; ysys='3';
/* Draw the first square */
color='CX7C95CA';
function='move'; x=10; y=65; output;
function='bar'; x=30; y=95; style='solid'; output;
/* Label the first square */
function='label'; x=10; y=63; position='6';
style="'Albany AMT/bold'"; size=2; text='CX7C95CA'; output;
/* Draw the second square */
color='CXDE7E6F'; style='solid';
function='move'; x=60; y=65; output;
function='bar'; x=80; y=95; output;
/* Label the second square */
function='label'; x=60; y=63; position='6';
style="'Albany AMT/bold'"; ; size=2; text='CXDE7E6F'; output;
/* Draw the third square */
color='CX66A5A0'; style='solid';
function='move'; x=10; y=15; output;
function='bar'; x=30; y=45; output;
/* Label the third square */
function='label'; x=10; y=12; position='6';
style="'Albany AMT/bold'"; ; size=2; text='CX66A5A0'; output;
/* Draw the fourth square */
color='gray'; style='solid';
function='move'; x=60; y=15; output;
function='bar'; x=80; y=45; output;
/* Label the fourth square and add a footnote */
function='label'; x=60; y=12; position='6';
style="'Albany AMT/bold'"; ; size=2; text='Gray'; output;
/* Write footnote */
x=85; y=3; position='5'; hsys='3'; size=3; color='black';
style="'Albany AMT/bold'";
text='Sample Annotate Output';
output;
/* Draw a black frame */
function='frame'; color='black'; when='b'; style='empty';
output;
run;
libname grafcat 'your-directory';
/* Generate annotate graphics */
proc ganno annotate=squares
gout=grafcat.graphs
description='Four squares';
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 creates an Annotate data set that draws four colored squares, displays the data set as a single graphics output, and stores the output as a catalog entry in a permanent graphics catalog.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> GANNO
|
| Date Modified: | 2005-07-23 03:02:37 |
| Date Created: | 2005-05-23 14:11:48 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | 8 TS M0 | n/a |