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 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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