Date: Tue, 23 Mar 2010 09:34:51 -0400
Reply-To: msz03@albany.edu
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mike Zdeb <msz03@ALBANY.EDU>
Subject: Re: how to draw vertical lines in graphs using annotate ?
Content-Type: text/plain;charset=iso-8859-1
hi ... another way to make all the SAS-supplied annotate macros available within a SAS session
is to use ...
%annomac;
LOG ...
6 %annomac;
*** ANNOTATE macros are now available ***
For further information on ANNOTATE macros, enter,
%HELPANO(macroname), (for specific macros)
%HELPANO(ALL), (for information on all macros)
or %HELPANO (for a list of macro names)
if you don't need (or want) all of them mucking up the SAS session,
try Robin's method of invoking just the ones you need
"less code" versus "just what you need"
--
Mike Zdeb
U@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
P/518-402-6479 F/630-604-1475
> One way is to first invoke the following SAS annotate macros:
>
> * macros to make lines (connect two specify x,y coordinates with a given
> line type and width);
>
> %MACRO move( x1, y1 ); %* MOVE to the requested ( X1,Y1 ) coordinate;
> X = &x1; Y = &y1; FUNCTION = "MOVE "; output;
> %MEND move;
>
> %MACRO draw( x1, y1, colin, lintyp, width ); %* DRAW a line to the
> requested ( X1,Y1 ) coordinate;
> X = &x1; Y = &y1; line = &lintyp; size = &width;
> IF "&colin" =: '*' THEN ; ELSE color = "&colin" ; FUNCTION = "DRAW ";
> output;
> %MEND draw;
>
> %MACRO line( x1, y1, x2, y2, colin, lintyp, width ); %* DRAW a line from
> (X1,Y1) to (X2,Y2) ;
> %move( &x1, &y1 );
> %draw( &x2, &y2, &colin, &lintyp, &width );
> %MEND line;
>
>
> Then, just specify the beginning and end coordinates of each line, color,
> line width, and type:
>
> DATA lne;
> RETAIN xsys '2' ysys '2' ; * lines with plot with x,y coordinates;
> LENGTH color $8 ;
> * from (x1, y1) to (x2, y2) / color/ line type / line width ;
> %line(x1,y1,x2,y2,black,21,2); * draw line with a dashed line (=21) weight
> 2;
>
> * change coordinates, to draw another line;
> %line(x1,y2,x2,y2,black,1,2); * draw solid line weight 2;
>
> * continue with %line() statements for additional lines;
>
> RUN;
>
>
> PROC GPLOT DATA=indat;
> plot y*x / annotate=lne;
> run; quit;
>
>
> Robin High
> UNMC
>
>
>
>
>
>
> From:
> Shaik Hymad <hymadsk@GMAIL.COM>
> To:
> SAS-L@LISTSERV.UGA.EDU
> Date:
> 03/23/2010 04:05 AM
> Subject:
> how to draw vertical lines in graphs using annotate ?
> Sent by:
> "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
>
>
>
> Hi All,
>
> I want ouput in figure like using proc gplot and using annotate option
>
>
> |
> |
> |
> | _ _
> | |......|
> | - -
> | | |
> | | |
> | | |
> | | |
> --|-----------|--------|-------
> 0 1 2
> x axis 0 to 1, i want to keep lines like mentioned above and in between i
> have keep word "prophy" like verically.
>
> Can you please let me know,how to do this in proc gpolot or any other way.
>
> Thanks,
> Hymad
>
|