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.
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.