Based on the SAS Online documentation https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/p07m2vpyq75fgan14m6g5pphnwlr.ht... the two following procedure should output a different graph.
What is missing here?
proc sgplot data=sashelp.class;
hbarbasic sex;
xaxis values=(0 to 10)
ranges=(0-20)
labelpos=datacenter;
run;
proc sgplot data=sashelp.class;
hbarbasic sex;
xaxis values=(0 to 10)
ranges=(0-20)
labelpos=center;
run;
From your link:
CENTER centers the axis label in the axis area (including any offsets).
DATACENTER centers the axis label in the axis tick display area (excluding any offsets).
You don't have any offset defined.
From your link:
CENTER centers the axis label in the axis area (including any offsets).
DATACENTER centers the axis label in the axis tick display area (excluding any offsets).
You don't have any offset defined.
What @ChrisNZ means is this:
proc sgplot data=sashelp.class;
hbarbasic sex;
xaxis
values=(0 to 10)
ranges=(0-10)
labelpos=datacenter
offsetmax=0.5
;
run;
proc sgplot data=sashelp.class;
hbarbasic sex;
xaxis
values=(0 to 10)
ranges=(0-10)
labelpos=center
offsetmax=0.5
;
run;
which gets your desired look.
Thank you to both of you.
I was so focused on the picture in the online doc, that I didn't realise that I should double check the definition.
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.