11-14-2012 02:53 PM
Is there a way to specify grid interval without specifying the minimum and max of the axis?
For example, we typically have this for the specs of the axis:
axis1 order=(0 to 100 by 10);
But my range for the axis changes and I don't want to specify it. But I need to specify the interval.
Is there a way to do that?
11-14-2012 03:13 PM
When I had a similar need I used to pull the max and min values of the variable, round up or down (floor and ceiling functions) as needed to multiples of the interval and had those values assigned to macro variables. Then the Axis definition would use the min and max macro variable values in the ORDER section of the Axis statement. The problem with this approach is your data may occasionally have a range large enough that for your desired interval the results are illegible or that SAS can't use such as 10 to 10000 by 10.
You might also experiment with using the MAJOR=(Number = n) to use a standard number of tick marks and let the interval fall as it may.
11-14-2012 03:19 PM
Would it suffice to include a short proc sql to get the min, max and interval into macro variables that could then be used for your axis statement? e.g.:
proc sql noprint;
axis1 order=(&min. to &max. by &interval.);
11-14-2012 03:58 PM
You might consider the IML routine GSCALE which will be more powerful(option wise) and produced more pleasing results.