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.

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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