BookmarkSubscribeRSS Feed
dantsui
Calcite | Level 5

In the attached figure, I would like to have the font size and style of x-axis labels to be the same with others (like y-axis, etc)

(Circled in the attached) I use "family="courier new" size=9 for all. But it seems not working on the mentioned.

 

The program code is:

options papersize=LETTER orientation = landscape nonumber nodate topmargin = 0.5 in bottommargin = 0.5 in
rightmargin = 0.5 in leftmargin=0.5 in ;

ods graphics on/border=on width=9.4in height=5.8in ;

ods listing gpath="&path./dev/programs/figures/output";
ods rtf file ="&path./dev/programs/figures/output/&pgmnum.(&pgmname.).rtf" startpage = yes nogtitle nogfootnote ;

proc sgplot data=all pad=(bottom=25% left=20%) uniform=all ;
where trtp~='';
*format typen type. trtan trt.;
vbar PARAM / response=percent group=trtpn groupdisplay=cluster name='a'
datalabel datalabelattrs=(family="courier new" size=9) dataskin=matte ;
keylegend 'a' / location=outside position=bottom valueattrs=(family="courier new" size=9);
xaxis display=(noticks) label='Treatment' LABELATTRS=(family="courier new" size=9);
yaxis display=all LABELATTRS=(family="courier new" size=9) offsetmin=0.02 offsetmax=0.1 thresholdmin=1 thresholdmax=1
label="Response Rate (%)" values=(0 to 42 by 5) ;
format trtpn trt.;
run;

ods graphics on/reset=all;
ods rtf close;

 

Thanks,

Daniel

3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

It works fine for me.

options papersize=LETTER orientation = landscape nonumber nodate topmargin = 0.5 in bottommargin = 0.5 in
        rightmargin = 0.5 in leftmargin=0.5 in ;

ods graphics on/border=on width=9.4in height=5.8in ;
ods listing gpath="&wdir";
ods rtf file ="&wdir/d.rtf" startpage = yes nogtitle nogfootnote ;

proc sgplot data=SASHELP.CLASS pad=(bottom=25% left=20%) uniform=all ;
  vbar AGE / response=WEIGHT group=SEX name='a'
             datalabel datalabelattrs=(family="courier new" size=9) dataskin=matte ;
  keylegend 'a' / location=outside position=bottom valueattrs=(family="courier new" size=9);
  xaxis display=(noticks) label='aa' labelattrs=(family="courier new" size=9);
  yaxis display=all labelattrs=(family="courier new" size=9) offsetmin=0.02 offsetmax=0.1 thresholdmin=1 thresholdmax=1
        label="bb" values=(0 to 42 by 5) ;
run;

ods rtf close;
ods graphics on/reset=all;

ChrisNZ_0-1594092983648.png

Please supply code we can run so we can replicate. And supply formatted code.

I did not see your graph as you provided it in a WORD file.

dantsui
Calcite | Level 5

I have found out the solution:

valueattrs will control the value text...

 

xaxis display=(noticks) label='Treatment' LABELATTRS=(family="courier new" size=9)
valueattrs=(family="courier new" size=9);

 

 

 

ChrisNZ
Tourmaline | Level 20

You post title says you want to format the label.

Option VALUEATTRS formats the values.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 4635 views
  • 0 likes
  • 2 in conversation