Hi, I'm running SGPLOTS and although the x-asix is the correct one, it doesn't show up as expected...
My code is
proc sgplot data = Data;
vline Date / response = NHPI y2axis;
xaxis values=('01Jan2010'd to '31Dec11'd by qtr);
xaxis Label = 'Date' Grid Values = (0 to 5 by 1);
refline '31Dec11'd / axis=x;
run;
But the X-Axis still shows up crammed and not readable (from the Jan2000 to Dec2011, rather then the time span specified)... any ideas? Thanks
Add TYPE=time on the first xaxis stmt and remove the second xaxis stmt.
xaxis type=time values=('01Jan2010'd to '31Dec11'd by qtr);
Hi:
Is it an accident that you have 2 XAXIS statements in your code? Each XAXIS statement has a VALUES= option.
cynthia
Thanks Cynthia, I removed the second xaxis line and got the same results..
Add TYPE=time on the first xaxis stmt and remove the second xaxis stmt.
xaxis type=time values=('01Jan2010'd to '31Dec11'd by qtr);
Thanks Sanjay.. works fine..
What line could I add if I wanted to show another variable as a secondary Y-Axis but on a different scale.. so have a left and right scale for each of the 2 vars? Thanks
See my recent article on this topic at Graphically Speaking
Great stuff.. Thank you.
Hey, what's the best way to show a correlation between Price and say Unemployement rate on a graph? I'm thinking a 2-Y axis chart?
Thanks,
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.