BookmarkSubscribeRSS Feed
twildone
Pyrite | Level 9

Hi....I am trying to get the xaxis tickvalues rotated nothing seems to work that I have tried. I even tried re-formatting the values for the xaxis to shorten then in length in characters. Right now the values are displayed at a 45 degrees and I would like them to be at 90 degrees. Any suggestions....thanks.

 

proc sgplot data=want21;
 	series x=Term y=Retention /  lineattrs=(color=blue thickness=2);
	series x=Term y=Persistence /  lineattrs=(color=red thickness=2);
	xaxis type=discrete fitpolicy=rotate valuesrotate=vertical;
	xaxis label='Year-Term' valueattrs=(size=7pt) labelattrs=(size=12pt weight=bold) ;
	yaxis label='Percentage' values=(0.5 to 1 by .1) valueattrs=(size=10pt) labelattrs=(size=12pt weight=bold);
run;
quit;
6 REPLIES 6
DanH_sas
SAS Super FREQ

Use VALUESROTATE=VERTICAL on the XAXIS statement.

twildone
Pyrite | Level 9
Hi DanH….I have included fitpolicy=rotate and valuesrotate=vertical but that's not working....are you suggesting to get rid of fitpolicy=rotate and only keep valuesrotate=vertical?
DanH_sas
SAS Super FREQ

You need to use ROTATEALWAYS instead of ROTATE for your fit policy to you want them to rotate when there is no collision.

twildone
Pyrite | Level 9

Hi DanH…..I changed the fitpolicy to RotateAlways and received a warning.

 

50         proc sgplot data=want21;
51          	series x=Term y=Retention /  lineattrs=(color=blue thickness=2);
52         	series x=Term y=Persistence  /  lineattrs=(color=red thickness=2);

53         	xaxis type=discrete fitpolicy=rotatealways valuesrotate=vertical;
                                          ____________
                                          1
WARNING 1-322: Assuming the symbol ROTATE was misspelled as rotatealways.
54         	xaxis label='Year-Term' valueattrs=(size=7pt) labelattrs=(size=12pt weight=bold) ;
55         	yaxis label='Percentage' values=(0.5 to 1 by .1) valueattrs=(size=10pt) labelattrs=(size=12pt weight=bold);
56         run;
DanH_sas
SAS Super FREQ

Sorry, it's available in GTL but COMING in the SG procedures. In the meantime, you can use TMPLOUT on the SGPLOT statement to dump out a GTL template, change ROTATE to ROATATEALWAYS on the fit policy, and render the template using PROC SGRENDER.

 

Hope this helps!

Dan

PeterClemmensen
Tourmaline | Level 20

You can use 

 

VALUESROTATE=vertical

in the XAXIS Statement as explained in the blog post Axis values display at the Graphically Speaking blog.

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
  • 6 replies
  • 2536 views
  • 0 likes
  • 3 in conversation