BookmarkSubscribeRSS Feed
tburus
Obsidian | Level 7

I am creating a plot using PROC SGPLOT and have very tight data labels on my x-axis. I tried using the FITPOLICY= option, but it's not doing anything (I assume this is because there is not actually any overlap). Is it possible to rotate the labels manually? I have researched this, but have not had any luck finding a solution.

 

My code:

title "Football Injuries Rates, by Event Type*";
footnote "*Scrimmages and walk-throughs were excluded";
proc sgplot data=rate_year;
	format event_type event_short.;
	styleattrs datacontrastcolors=("&Dblue" "&DGray")
               datasymbols=(circlefilled)
               datalinepatterns=(solid);
	series x=year y=injrate_unwgt / group=event_type markers;
	xaxis grid fitpolicy=rotate;
	yaxis grid values=(0 to 50 by 5) label="Injury Rate per 1000 AE";
	keylegend / title='';
run;
title;
footnote;

Output:

SGPlot38.png

1 REPLY 1
smantha
Lapis Lazuli | Level 10

try padding the year with leading and trailing spaces so that each of them is a $16. and try it

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 1 reply
  • 697 views
  • 0 likes
  • 2 in conversation