Chapter Contents

Previous

Next
SAS/GRAPH Software: Reference

Example 3: Drawing a Circle of Stars

Features:
Annotate function: BAR
CNTL2TXT
FRAME
LABEL
MOVE
PIECNTR
PIEXY
Annotate variables: COLOR
HSYS, XSYS, YSYS
LINE
STYLE
TEXT
X and Y
XLAST and YLAST
XLSTT and YLSTT
Sample library member: GR10N03

[IMAGE]

This example shows how to use an Annotate data set to draw a flag that is composed of a rectangle and four stars. The stars are positioned by placing them on an imaginary circle. The program uses the PIECNTR and PIEXY functions to find the points on the circle and the CNTL2TXT programming function to transfer coordinate values. It also processes Annotate assignment statements in a DO loop. The GANNO procedure displays the Annotate graphics.
 Note about code
goptions reset=global cback=white colors=(black);
 Note about code
data flag;
   length function style color $ 8 text $ 30;
   retain xsys ysys hsys '3';
 Note about code
   function='frame'; output;
 Note about code
   function='label'; x=92; y=5; text='GR10N03';
      style='swiss'; size=3; position='5'; output;
 Note about code
   x=50; y=90; text='Flag of Micronesia';
      style='swissb'; size=6; output;
 Note about code
   function='move'; x=20; y=30; output;
   function='bar'; x=80; y=80; color='blue';
      line=3; style='solid'; output;
run;
 Note about code
do star_ang=0 to 270 by 90;
 Note about code
   function='piecntr': x=50; y=55; size=15; output;
   function='piexy': size=1; angle=star_ang; output;
 Note about code
   function='cntl2txt'; output;
   function 'label'; style='marker'; text='V';
      angle=0; color='white'; size=10; x=.; y=.;
      output;
   end;
run;
 Note about code
proc ganno annotate=flag;
run;
quit;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.