- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
What do you get when you specify INTERVAL=QUARTER on your XAXIS statement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
/* x axis column date_mmddyyyy has the format mmddyy10. : for ex: 03/31/2009 */
proc sgplot data=graph;
XAXIS Label="YYYYQ" valuesformat=yyq6.
interval=quarter valuesrotate=vertical fitpolicy=rotate;
band x=date_mmddyyyy lower=0 upper= _freq_ / y2axis name="v3";
series x=date_mmddyyyy y=mean;
series x=date_mmddyyyy y=median;
run;
Below is the note, I get when I execute the program.
NOTE: TICKVALUEFITPOLICY=Rotate is ignored when SPLITTICKVALUE=TRUE. The default THIN policy is used.
NOTE: Some of the tick values have been thinned.
NOTE: TICKVALUEFITPOLICY=Rotate is ignored when SPLITTICKVALUE=TRUE. The default THIN policy is used.
NOTE: Some of the tick values have been thinned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Smaller font? Larger plot? Rotate the axis labels?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have not tried reducing the font size. I will give it a try and see if it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try the following
xaxis values=(a to b by 1);
a means the start value
b means the end value