BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
seanrez
Fluorite | Level 6

I'm having zero success controlling the distance between x-axis ticks/labels. Here's my code, with different things I've tried like type=discrete, interval=week, values=(), etc...

 
proc sgplot data = work.weather_adjustment_daily;
	vbar del_date / response = Weather_Adjustment;
	vline del_date / response = Temperature y2axis lineattrs = (thickness = 2);
	vline del_date / response = Temp_Norm y2axis lineattrs = (thickness = 2);
	vline del_date / response = Temp_One_Year_Ago y2axis lineattrs = (thickness = 2);
/*	xaxis type = discrete  interval = week */
/*	xaxis values = (%sysfunc(intnx('month', %sysfunc(today()), -2)) to %sysfunc(intnx('month', %sysfunc(today()), 2)) by 7)*/
/*	axis order = ('01Jan2018' to '01Jan2020' by 10);*/
	xaxis label = "Date";
	yaxis label = "Weather Adjustment (MW)";
	y2axis label = "Daily Mean Temperature";
	title "Daily Weather Adjustment and Temperature";
run;
My chart is below, with too many x-axis labels. I'm using SAS v9.3.
Capture.JPG
1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

You need to choose a different FITPOLICY on the XAXIS statement. For SAS 9.3, these are the policies supported:

 

THIN
ROTATE
ROTATETHIN
STAGGER
STAGGERROTATE
STAGGERTHIN

 

Hope this helps!

Dan

View solution in original post

1 REPLY 1
DanH_sas
SAS Super FREQ

You need to choose a different FITPOLICY on the XAXIS statement. For SAS 9.3, these are the policies supported:

 

THIN
ROTATE
ROTATETHIN
STAGGER
STAGGERROTATE
STAGGERTHIN

 

Hope this helps!

Dan

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 3582 views
  • 2 likes
  • 2 in conversation