BookmarkSubscribeRSS Feed
xxformat_com
Barite | Level 11

Hi,

 

When the axis label is displayed on more than one line, it is displayed properly unless the xaxistable statement is used.

 

Is there an option to avoid this behavior?

 

ods graphics / height=200px width=400px;

proc sgplot data=sashelp.class;
    vbarbasic sex / response=height stat=mean;
    yaxis label='This is a long label on several lines to illustrate the problem';
    
   *xaxistable sex;
   *xaxistable sex / label='this is a long label' ;
run;     
1 REPLY 1
ballardw
Super User

One thing to consider when discussing sizes of graphs: PX is not standard. You PX may be larger or smaller than mine due to monitor resolution. So setting sizes in terms of PX is almost always questionable.

 

Second, you have not actually stated what you want as a solution. Is it to display a long label and not have an Axistable label? Display both?

 

You may be able to control where the Axis label splits by inserting characters such as:

proc sgplot data=sashelp.class ;
    vbarbasic sex / response=height stat=mean;
    yaxis label="This is a long label(*ESC*){unicode '000a'x} on several lines to (*ESC*){unicode '000a'x}illustrate the problem"
   ;
    
   xaxistable sex/;
   /*xaxistable sex / label='this is a long label' ;*/
run;  

The (*ESC*) is equivalent to ESCAPECHAR for inserting style elements in the places where the define Escapechar may not be recognized.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 92 views
  • 2 likes
  • 2 in conversation