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 (October 2006, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 31 Oct 2006 10:50:40 -0500
Reply-To:     Jake Bee <johbee@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jake Bee <johbee@GMAIL.COM>
Subject:      Re: Problem with data anno; and proc gplot in getting x y labels
              on plot
Comments: To: Ya Huang <ya.huang@amylin.com>
In-Reply-To:  <200610311453.k9VBklho028758@mailgw.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Yes, you are so correct. When I check my BP data that's exactly what I have, I think I got sys confused with systolic and changed it in the weight procedure. Thanks so much!

Jake

On 10/31/06, Ya Huang <ya.huang@amylin.com> wrote: > > Change this: > > retain xhWT '3' yhWT '3' function ....; > > to this: > > retain xsys '3' ysys '3' function ....; > > You may need to change the x,y coordinates too to fit. > > > On Tue, 31 Oct 2006 08:05:25 -0500, Jake Bee <johbee@GMAIL.COM> wrote: > > >Group, > >Any experience with gplot and anno. I have trouble getting the legend on > the > >page (error below, then code). The plot is for weight (I have a similar > on > >for Blood Press that works fine.) I guess I don't really understand the > x > y > >coordinates for the legend. Any help with this code, or references to > >annotation and glpot would be appreciated. > >Thanks! > >Jake > >----------------example error ------------------------ > > > >NOTE: ERROR DETECTED IN ANNOTATE= DATASET WORK.ANNO. > > > >NOTE: PROBLEM IN OBSERVATION 1 - > > > > A CALCULATED COORDINATE LIES OUTSIDE THE VISIBLE AREA Y > > > >NOTE: PROBLEM IN OBSERVATION 2 - > > > > A CALCULATED COORDINATE LIES OUTSIDE THE VISIBLE AREA Y > > > >NOTE: PROBLEM IN OBSERVATION 3 - > > > >-------------- example code ------------------------ > > > >options mprint mlogic symbolgen merror nodate number pageno=1 ls=132 > >ps=60; > > > > > > > > > > > >%macro wt(mon,when,toprint=N,outside_legend=Y,plot_label=Study > >testing); > > > > > > data wt_graph; > > > > > > set wt(where=(month=&mon));; > > > > > > length hWT $1 c_weight $3; > > > > > > hWT=''; > > > > > > if wt >= 155 then > > > > > > do; > > > > > > hWt='H'; > > > > > > end; > > > > > > else > > > > > > if wt < 155 then > > > > > > do; > > > > > > hWt='L'; > > > > > > end; > > > > > > > > > > > > c_weight=put(wt,3.); > > > > > > run; > > > > > > > > > > > > proc format; > > > > > > value $m_fmt > > > > > > 1='JAN' > > > > > > 2='FEB' > > > > > > 3='MAR' > > > > > > 4='APR' > > > > > > 5='MAY' > > > > > > 6='JUN' > > > > > > 7='JUL' > > > > > > 8='AUG' > > > > > > 9='SEP' > > > > > > 10='OCT' > > > > > > 11='NOV' > > > > > > 12='DEC'; > > > > > > run; > > > > > > quit; > > > > > > > > > > > > %if %upcase(&toprint)=N %then > > > > > > %do; > > > > > > goptions reset=all cback=white border; > > > > > > %end; > > > > > > %else > > > > > > %if %upcase(&toprint)=Y %then > > > > > > %do; > > > > > > goptions reset=all cback=white border device=HPGL3SI; > > > > > > %end; > > > > > > > > > > > > data anno; > > > > > > length text $12. color $8.; > > > > > > retain xhWT '3' yhWT '3' function 'label' when 'a' y_pct 92 hhWT > '4' > >size .75; > > > > set wt_graph; > > > > > > if _n_ = 1 then do; > > > > > > %if %upcase(&outside_legend)=N %then > > > > > > %do; > > > > > > x= 60; y= 92; text='DAY'; color='black'; output; > > > > > > x= 65; y= 92; text='hWT'; color='blue'; output; > > > > > > x= 70; y= 92; text='WGT'; color='black'; output; > > > > > > x= 75; y= 92; text='Exc'; color='black'; output; > > > > > > %end; > > > > > > %else > > > > > > %if %upcase(&outside_legend)=Y %then > > > > > > %do; > > > > > > x= 5; y= 92; text='DAY'; color='black'; output; > > > > > > x= 10; y= 92; text='hWT'; color='blue'; output; > > > > > > x= 15; y= 92; text='WGT'; color='black'; output; > > > > > > x= 20; y= 92; text='Exc'; color='black'; output; > > > > > > %end; > > > > > > end; > > > > > > > > > > > > y_pct=y_pct-5; > > > > > > > > > > > > %if %upcase(&outside_legend)=N %then > > > > > > %do; > > > > > > x= 60; y=y_pct; text=put(day,2.); color='black'; > >output; > > > > x= 65; y=y_pct; text=hWT; color='red'; > >output; > > > > x= 70; y=y_pct; text=c_weight; color='black'; > >output; > > > > x= 75; y=y_pct; text=exercise; color='black'; > >output; > > > > %end; > > > > > > %else > > > > > > %if %upcase(&outside_legend)=Y %then > > > > > > %do; > > > > > > x= 5; y=y_pct; text=put(day,2.); color='black'; > >output; > > > > x= 10; y=y_pct; text=hWT; color='red'; > >output; > > > > x= 15; y=y_pct; text=c_weight; color='black'; > >output; > > > > x= 20; y=y_pct; text=exercise; color='black'; > >output; > > > > %end; > > > > > > > > > > > > run; > > > > > > > > > > > > * Note i=r in symbol statement --> Regression line *; > > > > > > > > > > > > symbol1 v='W' i=join c=blue; > > > > > > > > > > > > axis1 minor=none value=(font=swiss) offset=(5,5) pct > > > > > > order=(1 to 31 by 1) width=3 length=80 label=('DAY') ; > > > > > > > > > > > > axis2 minor=none value=(font=swiss) offset=(0,0) pct order=(140 to > 180 > >by 5) > > > > label=('WEIGHT') width=3; > > > > > > /* reflabel=(j=c '60' '80' '100' '120' '140' '160' '180'); > >*/ > > > > > > > > > > > > > > > > > > legend1 value=(tick=3) across=1; > > > > > > > > > > > > title h=3 pct "&plot_label &when"; > > > > > > > > > > > > proc gplot data=wt_graph; > > > > > > plot wt*day / overlay haxis=axis1 vaxis=axis2 anno=anno > >legend=legend1 > > > > vref=140 145 150 155 160 165 170 175 > >180; > > > > > > /* vref=60 80 100 120 140 160 180; > > */ > > > > > > run; > > > > > > quit; > > > > > >%mend wt; > > > > > > > > > > > >data wt; > > > > > >length exercise $10; > > > > > > > > > > > >input wt month day exercise $; > > > > > >cards; > > > > > > 171.9 9 01 Lift > > > > > > 167.4 9 04 Run > > > > > > 166.6 9 11 MN > > > > > > 165.3 9 18 None > > > > > > 162.9 9 25 Run > > > > > > 167.8 10 02 None > > > > > > 164.7 10 09 Run > > > > > > 161.4 10 16 MN > > > > > > 148.0 10 25 Run > > > > > > 140.0 10 29 Diet > > > > > >; > > > > > >run; > > > > > > > > > > > >title "Weight Data"; > > > > > >title2 &sysdate &systime; > > > > > > > > > > > >proc print data=wt; > > > > > >run; > > > > > > > > > > > >%wt( 9,September 2006);; > > > >%*wt(10,October 2006);; >


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