Help using Base SAS procedures

intervals on x-axis

Reply
Super Contributor
Posts: 395

intervals on x-axis

I'm doing a sgplot and the Date formet (on the x-axis) is in a YYMMP7. format (eg. 2005.04) over a period of 10 years or so..  I wish it to see the x-interval from May2010 to Aug2013, bi-annual, but instead all the values show up.. and it looks like a black block.  Thanks

Here is my code:

proc sgplot data = MS.Centract_ALL4;

where City= 'Toronto';

vbar date / response=Counts;

vline date / response=Price y2axis;

vline date / response=Orig_Price y2axis;

xaxis Values = ("01May2010"d to "01Aug2013"d by 2) Label = 'Date';

run;

Super User
Posts: 10,483

Re: intervals on x-axis

It is probably showing as a "black block" because of many tick values overwriting each other.

Since the Date values are days offset from Jan 1, 1960 the request by 2 is probably asking for a tick every 2 days.

Try using

xaxis Values = ("01May2010"d to "01Aug2013"d ) Label = 'Date' interval=semiyear;

Ask a Question
Discussion stats
  • 1 reply
  • 285 views
  • 0 likes
  • 2 in conversation