BookmarkSubscribeRSS Feed
mano
Calcite | Level 5

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.

3 REPLIES 3
Reeza
Super User

What proc are you using, example code is useful.

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

mano
Calcite | Level 5

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;

BrunoMueller
SAS Super FREQ

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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1282 views
  • 0 likes
  • 3 in conversation