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
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;
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.
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);
You post title says you want to format the label.
Option VALUEATTRS formats the values.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.