BookmarkSubscribeRSS Feed
podarum
Quartz | Level 8

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;

1 REPLY 1
ballardw
Super User

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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1849 views
  • 0 likes
  • 2 in conversation