Date: Mon, 13 Apr 2009 08:58:26 -0400
Reply-To: msz03@albany.edu
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mike Zdeb <msz03@ALBANY.EDU>
Subject: Re: Font in Annotate to create a legend
Content-Type: text/plain;charset=iso-8859-1
hi ... here's is your ANNOTATE problem ... in this data step
data anno_1;
length function style color $ 8 text $ 30;
retain xsys ysys hsys '3';
function='move'; x=32; y=6; output;
function='bar'; x=24; y=2; color="CXE5B82E"; line=1;
style='solid'; output;
function='label'; style='"arial/bo"' ; position='3'; xsys='3';
x=34;
ysys='3';y=.2; text='Spend'; size=4.5; color='black'; output;
run;
the LENGTH statement sets the length of STYLE as 8, but then you have STYLE = '"arial/bo"';
there are 10 characters in that FONT name since the double quotes count as part of the string
if I use your data step, the LOG shows ...
WARNING: Font "ARIAL/B could not be used.
Font SIMPLEX substituted for font "ARIAL/B.
you can see that the FONT name is truncated at 8 characters because of the LENGTH statement and the double quotes are part of the
character string
if I use this instead of your LENGTH statement ...
data anno_1;
length function color $ 8 style $10 text $ 30;
and the correct font is used in the final output
if you want style = '"calibri/bo"';
you would need to change the LENGTH again
data anno_1;
length function color $ 8 style $12 text $ 30;
--
Mike Zdeb
U@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
P/518-402-6479 F/630-604-1475
> Hi
> As per my previous question I asked that how to use font in annotate?
> but still the font is not coming properly if i am using any font!!!
> the piece of code i have written here to make my query easier.
>
> 1-Here in Annotate I am using "'Arial/BO'" but the font is coming in
> irregular order .
> 2-The graph code which i have written is just a supportive code to use
> this anno_1 dataset.
>
> data anno_1;
> length function style color $ 8 text $ 30;
> retain xsys ysys hsys '3';
>
> function='move'; x=32; y=6; output;
> function='bar'; x=24; y=2; color="CXE5B82E"; line=1;
> style='solid'; output;
>
> function='label'; style='"arial/bo"' ; position='3'; xsys='3';
> x=34;
> ysys='3';y=.2; text='Spend'; size=4.5; color='black'; output;
>
> run;
>
> This is the code i am using and calling this Anno_1 into my code which
> is as follow........
>
>
>
> goptions reset=all;
> goptions device=gif;
> goptions ftext=calibri nodisplay;
>
> Axis1
>
> Label=(ANGLE=360 JUSTIFY=RIGHT COLOR=white FONT="Calibri/bold"
> HEIGHT=1pt "")
> Value=(color=gray font="Calibri/bold" height=11pt angle=55 rotate=0)
> Offset=(4,4)
> MAJOR=(h=0.5)
> MINOR=NONE
> order=('01JUN07'd to '01JUN08'd by month)
> ;
>
> Axis2
>
> Label=(ANGLE=90 JUSTIFY=right HEIGHT=13pt COLOR=BLACK FONT="Calibri/
> bold" "Spend (in mlns)")
> Value=(j=right font="Calibri/bold" height=12pt color=gray)
> Major=(h=1)
> MINOR=NONE
> offset=(0,2)
> order=(0 to 500 by 100);
>
> Axis3
>
> Label=(ANGLE=90 COLOR=BLACK FONT="Calibri/bold" HEIGHT=13pt
> JUSTIFY=right "Transaction (in mlns)")
> Value=(j=right Font="Calibri/bold" height=12pt color=gray)
> Major=(h=1)
> MINOR=NONE
> offset=(0,2)
> order=(0 to 2 by 0.4);
>
> symbol1
> i=needle
> v=none
> line=1
> width=30
> ci=CXE5B82E;
> ;
>
> symbol2
> i=spline
> v=none
> width=1.5
> line=1
> color=CX0000FF
> ;
>
> legend1 label=none shape=line(5) value=(height=10pt Font="Calibri/
> bold" 'Spend')
> position=(bottom center outside) ;
>
> legend2 label=none shape=line(5) value=(HEIGHT=10.5pt FONT="Calibri/
> bold" 'Transactions')
> position=(bottom center outside) offset=(8,0);
>
>
> Title1 j=center Color=black height=0.50cm font="Calibri/bold" "POS
> Spend & Transaction";
>
> goptions xpixels=850 ypixels=300;
>
> proc gplot data=data.spend_3g anno=anno_1;
> plot Tspend_ml*month1/
> haxis=axis1
> vaxis=axis2
> overlay
> NOFRAME
> /* legend=legend1*/
> name='gr3'
> ;
> plot2 Transactions_ml*month1/
> vaxis=axis3
> legend=legend2
> overlay;
>
> format transactions_ml comma15.1;
> run;
> quit;
>
>
> But when i am running this code the legend which i am creating using
> annotate is not coming properly .i Mean to say that the font is not
> proper?which font i should use? or how can i define my hardware font?
> one time I asked this question already but still its not clear for
> me ???Please help me
>
>