BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
xxformat_com
Barite | Level 11

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;
1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

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.

 

View solution in original post

3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

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.

 

Kurt_Bremser
Super User

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.

xxformat_com
Barite | Level 11

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.

sas-innovate-white.png

Our biggest data and AI event of the year.

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.

 

Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 807 views
  • 3 likes
  • 3 in conversation