DATA Step, Macro, Functions and more

how to get "100 µg" in SAS graph output

Reply
Contributor
Posts: 28

how to get "100 µg" in SAS graph output

Hi,

I am trying to create graphical output and I am using the following legend statement to show Placebo, 50 µg, 100 µg, 250 µg :-

Legend1 value=(color=blue height=3 'Placebo' '50 µg' '100 µg' '250 µg');

But this statement is not creating the special symbol and just showing 'Placebo' '50  g' '100  g' '250  g'.

Can any one please help me with code to get special characters printed in the RTF output.

Thanks,

Mano.

Super User
Posts: 19,878

Re: how to get "100 µg" in SAS graph output

What proc are you using, example code is useful.

How are you adding in the micro symbol in your text?

Contributor
Posts: 28

Re: how to get "100 µg" in SAS graph output

Hi,

Below is the code that I am using. I copied and pasted the text of treatment labels in my editor window of SAS. I am using SAS 9.1.3 version:-

****Graphics Options****;

  goptions

    device=png

    targetdevice=png

    xmax=23.4cm

    ymax=13.5cm

    ftext="arial"

    htext=0.5

    noborder

    ;

*--------------------------------------------------------------------------------------------*;

* Create symbol for each dose level

*--------------------------------------------------------------------------------------------*;

Legend1 value=(color=blue height=3 'Placebo' '50 µg' '100 µg' '250 µg');

symbol1 interpol=join h=1.5 line=1 value=dot color=black;

symbol2 interpol=join h=1.5 line=1 value=dot color=red;

symbol3 interpol=join h=1.5 line=1 value=dot color=green;

symbol4 interpol=join h=1.5 line=1 value=dot color=blue;

/* Specify AXIS statements */

/*Horizontal axis*/ 

  axis1 label =(height=2.5 f='arial' "Study Visit" j=left)

  order=(0 to 5 by 1)

  value =(font = 'arial' h=2.5

  tick=0 "" 

  tick=1 ""

  tick=2 "baseline"

  tick=3 "Month 3"

  tick=4 "Month 6"

  tick=5 "Month 12"

  tick=6 ""

  )

  offset=(2,2) minor=none major=none;

/*Vertical axis*/

axis2 order=(&ymin to &ymax by &y_int) label = (height=2.5 f='arial' angle = 90 "Mean Change from Baseline in &cat")

      value=(height=2.5 font = 'arial') minor =none;

run;

*--------------------------------------------------------------------------------------------*;

* ods formatting

*--------------------------------------------------------------------------------------------*;

goptions reset=goptions device=png       

  gunit = pct

        rotate = landscape

        xmax=22cm ymax=12.3cm

  htext=10pt ;

ods rtf nogtitle nogfoot;

ods listing close;

ods rtf file="&pathlis.\figures\&outname..rtf" style=tfl headery=1700 footery=845 author="&sysuserid";

proc gplot data = _tr1;

  plot yvar*visn=trtan/haxis= axis1 vaxis = axis2 legend=legend1  ;

run;

ods rtf close;

ods listing;

SAS Super FREQ
Posts: 709

Re: how to get "100 µg" in SAS graph output

Check out this code, for me it seems to work with no problem, I use SAS9.4. I also added an example using SGPLOT

data have;
  length midpoints $ 32;
 
do midpoints = 'Placebo', '50 µg', '100 µg', '250 µg';
    value = ceil( ranuni(
0) * 10);
    output;
 
end;
run;
Legend1 value=(color=blue height=1
/*'Placebo' '50 µg' '100 µg' '250 µg'*/
);

proc gchart data=have;
  vbar midpoints / subgroup=midpoints sumvar=value legend=legend1;
run;
quit;

proc sgplot data=have;
  vbar midpoints / group=midpoints response=value;
run;
Ask a Question
Discussion stats
  • 3 replies
  • 233 views
  • 0 likes
  • 3 in conversation