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
;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.