BookmarkSubscribeRSS Feed
deleted_user
Not applicable
1) How do I specify that the y-axis always starts at 0 where SAS chooses the max and interval for the order function.

2) Is it possible to specify that the y-axis starts at 0 and specify the interval and let SAS choose the max for the order function?

If the order function does not permit this is there another function that does allow me to do this?
Thank you.
5 REPLIES 5
DanH_sas
SAS Super FREQ
If you have SAS 9.2, you can make this specification easily using PROC SGPLOT. To make the axis start at 0 and let the procedure determine the max and intervals, just specify MIN on the proc's axis statement:

proc sgplot data=sashelp.class;
yaxis min=0;
scatter x=weight y=height;
run;
GraphGuy
Meteorite | Level 14
Since you were specifically asking about gplot, here's how to do #1 in gplot:

proc gplot data=sashelp.class;
plot height*weight / vzero;
run;

Per #2, I don't know of a way to do that. There is a request for this feature in the defects/request system, and it might help bump up the priority of adding that feature if customers call Tech Support showing their interest, and providing specific examples of the things they'd like to be able to do with this feature. Here is the defect/request number to refer to:

S0134846: PROVIDE THE ABILITY TO SPECIFY JUST START, END, OR INCREMENT ON AXIS ORDER=
Peter_C
Rhodochrosite | Level 12
I assumed everyone, just used proc sql to select the max into a macro var, to use in the order list
Peter_C
Rhodochrosite | Level 12
gets a little more sophisticated (ceil(), log) to pick a suitable multiple rounded above the max
proc sql noprint ; **** getting max number of members and time ;
select max(members) format= 8., max( time ) format= 8.
into :max_Members, :max_time
from &syslast ;
quit ;
******now convert to next log-base10 interval, and next 10 time-axis-inteval ;
%let max_time_ax = %sysfunc( ceil( &max_time /10))0;
%let max_mems_10 = %sysfunc( length( &max_members ) ) ;

the members axis was to be logbase=10
deleted_user
Not applicable
Thank you.
vzero worked well.

SAS Innovate 2025: Register Now

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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1631 views
  • 0 likes
  • 4 in conversation