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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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