Hi all,
I believe the answer for this should be simple but going through all the sas documentation for SGplots has given me nothing that works.
I'm using sas 9.4
I'm trying to standardize the range of the X axis between 50 and 90 in a simple regression.
I have the following code
proc SGplot data=have;
by task;
reg x=year y=score / nomarkers group=group clm clmtransparency=0.6;
Xaxis values= (50 TO 90 by 5) ranges=(50-90);
Xaxis label= "Age years";
run;
I first tried with a min and max statement, doesn't work because that's just the values, then the Values as that defines the tick marks and I figured it would show all the tick marks i asked for, but that didn't work either. Then ranges but that is for splitting ranges
Any idea how i can have the x axis range between 50 and 90 ?
Thanks heaps.
@P20 wrote:
Hi all,
I believe the answer for this should be simple but going through all the sas documentation for SGplots has given me nothing that works.
I'm using sas 9.4
I'm trying to standardize the range of the X axis between 50 and 90 in a simple regression.
I have the following code
proc SGplot data=have;
by task;
reg x=year y=score / nomarkers group=group clm clmtransparency=0.6;
Xaxis values= (50 TO 90 by 5) ranges=(50-90);
Xaxis label= "Age years";
run;
I first tried with a min and max statement, doesn't work because that's just the values, then the Values as that defines the tick marks and I figured it would show all the tick marks i asked for, but that didn't work either. Then ranges but that is for splitting ranges
Any idea how i can have the x axis range between 50 and 90 ?
Thanks heaps.
The first "xaxis" that you ended with a ; is ignored because you included an entire additional XAXIS statement. You may only have one XAXIS statement and the last in the code will likely be the one to be applied.
Try
Xaxis values= (50 TO 90 by 5) ranges=(50-90) label= "Age years";
I don't understand your quesiton.
If you want limit the X value,you can exclude these points by :
proc SGplot data=have(where=(year between 50 and 90));
And Better post a sample data to test your code ,that would better help to explain your Q.
@P20 wrote:
Hi all,
I believe the answer for this should be simple but going through all the sas documentation for SGplots has given me nothing that works.
I'm using sas 9.4
I'm trying to standardize the range of the X axis between 50 and 90 in a simple regression.
I have the following code
proc SGplot data=have;
by task;
reg x=year y=score / nomarkers group=group clm clmtransparency=0.6;
Xaxis values= (50 TO 90 by 5) ranges=(50-90);
Xaxis label= "Age years";
run;
I first tried with a min and max statement, doesn't work because that's just the values, then the Values as that defines the tick marks and I figured it would show all the tick marks i asked for, but that didn't work either. Then ranges but that is for splitting ranges
Any idea how i can have the x axis range between 50 and 90 ?
Thanks heaps.
The first "xaxis" that you ended with a ; is ignored because you included an entire additional XAXIS statement. You may only have one XAXIS statement and the last in the code will likely be the one to be applied.
Try
Xaxis values= (50 TO 90 by 5) ranges=(50-90) label= "Age years";
That worked, thank you!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.