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;
Use VALUESROTATE=VERTICAL on the XAXIS statement.
You need to use ROTATEALWAYS instead of ROTATE for your fit policy to you want them to rotate when there is no collision.
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;
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
You can use
VALUESROTATE=vertical
in the XAXIS Statement as explained in the blog post Axis values display at the Graphically Speaking blog.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.