Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!

How to prevent scatter plot axis labels from being cut off

Accepted Solution Solved
Reply
Contributor
Posts: 20
Accepted Solution

How to prevent scatter plot axis labels from being cut off

Hi for the attached graph, my axis labels are cut off for the middle and third rows. how do I prevent this? thank you.

 

here is the code I'm using: 

proc sgscatter data=mydata;
title "Spatial Gait Symmetry Parameters vs. SF-36 Functional Scores";
compare x=(PF VT GH)
		y=(speed_SymIdx_iqr cadenceSymIdx_iqr peakswing_SymIdx_iqr maxTC2_SymIdx_iqr)
		/loess=(nogroup) group=group
		markerattrs=(symbol=CircleFilled size=14)
   filledoutlinedmarkers 
   colormodel=(CX3288BD CX99D594 CXE6F598 CXFEE08B CXFC8D59 CXD53E4F);
   LABEL PF='Physical Function' VT='Vitality' GH='General Health'
    speed_SymIdx_iqr='Strike Speed(IQR)'
    peakswing_SymIdx_iqr='Peak Angular Velocity_IQR'
    maxTC2_SymIdx_iqr='2nd Max-Toe Clearance_IQR';
   format group group.;
   run; quit;

 


Accepted Solutions
Solution
‎04-07-2018 10:33 PM
Super User
Posts: 24,028

Re: How to prevent scatter plot axis labels from being cut off

If you have SAS 9.4+ you can try the SPLITCHAR or FITPOLICY option. I'm not sure what version it's available in, it may be later versions. 

 

PS. If you post code that references a SASHELP data set we can run the code and test the options. 

 

Documentation with some examples here:

http://documentation.sas.com/?docsetId=grstatproc&docsetTarget=p1kiem0vt5yk8sn14amo4z5l76d2.htm&docs...

View solution in original post


All Replies
PROC Star
Posts: 635

Re: How to prevent scatter plot axis labels from being cut off

Unfortunately there is no option in SAS for controlling the Axis label. But you can custom code them using the Annotation which is little tricky. 

 

Check these: https://support.sas.com/resources/papers/proceedings11/277-2011.pdf

https://stats.idre.ucla.edu/sas/code/generating-multiline-axis-labels-in-sas-proc-sgplot/

 

Thanks,
Suryakiran
Solution
‎04-07-2018 10:33 PM
Super User
Posts: 24,028

Re: How to prevent scatter plot axis labels from being cut off

If you have SAS 9.4+ you can try the SPLITCHAR or FITPOLICY option. I'm not sure what version it's available in, it may be later versions. 

 

PS. If you post code that references a SASHELP data set we can run the code and test the options. 

 

Documentation with some examples here:

http://documentation.sas.com/?docsetId=grstatproc&docsetTarget=p1kiem0vt5yk8sn14amo4z5l76d2.htm&docs...

Super User
Posts: 24,028

Re: How to prevent scatter plot axis labels from being cut off

I've moved this to the Graphics forum, so the SAS Graph staff can assist if required.
☑ This topic is solved.

Need further help from the community? Please ask a new question.

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