LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 23 Jun 2004 17:17:25 -0400
Reply-To:   "Huang, Ya" <yhuang@AMYLIN.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Huang, Ya" <yhuang@AMYLIN.COM>
Subject:   Re: arrows
Comments:   To: Carlos Tadeu <ctsdias@CARPA.CIAGRI.USP.BR>

You should be able to draw almost anything with annotate data set. I had a post 2 years ago for similar graph. Here is a modified version, hopefully it is what you need.

data T; input LABEL $ Yi Xi; cards; a 2 3 b 3 6 c -4 -9 d 5 1 X -6 4 Y 5 7 Z 7 -3 ;

data anno; set t; length function style color text position $ 8; retain hsys xsys ysys '2' style 'swiss' position '5'; if label='a' then color='red'; else if label='b' then color='green'; else if label='c' then color='blue'; else if label='d' then color='yellow'; else if label='X' then color='pink'; else if label='Y' then color='tab'; else if label='Z' then color='purple'; function='move'; x=0; y=0; size=0.1; output; function='draw'; x=xi; y=yi; size=0.1; output; function='label'; x=xi; y=yi; size=1; alpha=atan((yi-0)/(xi-0))*180/3.1415926; if xi>0 and yi>0 then angle=alpha; else if xi>0 and yi<0 then angle=alpha+360; else if xi<0 and yi<0 then angle=alpha+180; else if xi<0 and yi>0 then angle=alpha+180; angle=angle-90; text='^'; position='5'; output; function='label'; x=xi; y=yi; text=label; size=1; angle=0; position='2'; output; run;

goptions reset=all gunit=pct;

data yy; x=0; y=0;

proc gplot; plot y*x / annotate=anno haxis=-10 to 10 vaxis=-10 to 10; run;

Kind regards,

Ya Huang


Back to: Top of message | Previous page | Main SAS-L page