The code below generates the horisontal bar chart in the picture. Within the code, in the xaxis statment the labelpos option place the xaxis label to the right. However, I would like to fine adjust the position of the xaxis label and place it a little bit to the left and below the row of thick values. Is this possible?
ods _all_ close;
ods listing
image_dpi = 300
gpath = "C:\Temp"
style = styles.listing
;
ods graphics on /
reset = all
outputfmt = png
imagename = "Supportcommunity"
scale = on
height = 15cm
width = 12cm
;
title "Car sales sum of invoice"
;
proc sgplot
data= sashelp.cars;
hbar type
/
group= origin
groupdisplay= cluster
response= Invoice;
xaxis valuesformat=COMMA12.0
label='US $'
labelpos= right
grid
offsetmax= 0.05;
yaxis labelpos=top;
keylegend / location=inside
position= bottomright
down=3
outerpad=(right=22 bottom=15);
run
;
title;
footnote;
ods graphics off;
ods pdf close;
ods listing close;
Just pad lots of blanks before "$US"?
title "Car sales sum of invoice"; proc sgplot data= sashelp.cars; hbar type / group= origin groupdisplay= cluster response= Invoice; xaxis valuesformat=COMMA12.0 label=" US $" grid offsetmax= 0.05; yaxis labelpos=top; keylegend / location=inside position= bottomright down=3 outerpad=(right=22 bottom=15); run ;
Just pad lots of blanks before "$US"?
title "Car sales sum of invoice"; proc sgplot data= sashelp.cars; hbar type / group= origin groupdisplay= cluster response= Invoice; xaxis valuesformat=COMMA12.0 label=" US $" grid offsetmax= 0.05; yaxis labelpos=top; keylegend / location=inside position= bottomright down=3 outerpad=(right=22 bottom=15); run ;
Interesting.
Padding white blanks has no effect to the generated picture "Supportcommunity.png".
But if you are using TAB characters instead of white blanks,then you could get job done.
ods _all_ close;
ods listing
image_dpi = 300
gpath = "C:\Temp"
style = styles.listing
;
ods graphics on /
reset = all
outputfmt = png
imagename = "Supportcommunity"
scale = on
height = 15cm
width = 12cm
;
title "Car sales sum of invoice";
proc sgplot
data= sashelp.cars;
hbar type
/
group= origin
groupdisplay= cluster
response= Invoice;
xaxis valuesformat=COMMA12.0
label=" US $"
grid
offsetmax= 0.05;
yaxis labelpos=top;
keylegend / location=inside
position= bottomright
down=3
outerpad=(right=22 bottom=15);
run
;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.