Hi All - I am trying to plot year-quarter values on the x axis using sgplot and have around 50 labels. When I use SGPlot, it only shows every alternative year quarter instead of all the 50 labels. Is there any way, I can show all possible value on the x-axis? I did explore 'values' options, but it might not a good option as the year-quarter information will vary based on my data.
Any thoughts / guidance will be appreciate.
What do you get when you specify INTERVAL=QUARTER on your XAXIS statement?
Please show the entire code you are using.
Also it may help to tell us the format currently assigned to the x-axis variable.
Are you getting any notes in the log about fitting values to your axis space?
For date axes, PROC SGPLOT will perform special processing to handle the fact that months are different lengths. The NOTE is telling you that the special processing is occurring. For example, see the results of each of these calls:
proc sgplot data=sashelp.stocks;
series x=date y=open / group=stock;
run;
proc sgplot data=sashelp.stocks;
where date < '01jan1990'd;
series x=date y=open / group=stock;
run;
Smaller font? Larger plot? Rotate the axis labels?
I have not tried reducing the font size. I will give it a try and see if it works.
Try the following
xaxis values=(a to b by 1);
a means the start value
b means the end value
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.