Date: Thu, 6 Nov 1997 05:46:45 -0500
Reply-To: Ron Mckean <rmckean@COMPUSERVE.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Ron Mckean <rmckean@COMPUSERVE.COM>
Subject: Re: Irregular axes under SAS/GRAPH
Content-Type: text/plain; charset=ISO-8859-1
On Nov 5th, "kmself@ix.netcom.com" wrote regarding his difficulties with
SAS/GRAPH axes.
Karsten, as I have done extensive work with SAS/GRAPH through most versions
since 6.03, I can sympathize with you. There are in fact significant
deficiencies in SAS/GRAPH when it comes to real world applications (and
what the 'USER' wants).
I have produced hundreds of graphics which were set to against a 'weekdays
only' scale resulting in the irregular scale warnings that you mention (no,
I never found any way of getting rid of them short of deleting the log).
Other issues I encountered include
- aligning the '0' tick mark on the left and right scales
- gradient matching
- logarithmic scales (the SAS options produce major tick marks of a
fixed spacing and variable increment, the user wanted variable
spacing with a fixed increment)
- aligning axes on overlayed plots and charts
- multiple GPLOT images stacked over a common 'X' axis
- creating a sensible scale to match the range of the incoming data
- etc, etc, etc
I invariably end up using GPLOT to draw the plot line only and everything
else, including axes and legends, are drawn by extensive annotate logic.
In regard to creating sensible scales I finally came up with the following
macro (I have not been able to test it under all possible scenarios but it
has proved to be stable where I have used it)
%macro scale;
range = maximum - minimum;
if range = 0 then range = 1;
rlog = log10(range) - int(log10(range));
if range < 1 then rlog = rlog + 1;
if rlog > 0.6 then incr = 1;
else if rlog > 0.3 then incr = 0.5;
else incr = 0.2;
if range < 1 then incr = incr / 10;
i = int(log10(range));
incr = incr * (10 ** i);
if minimum < 0 then minimum = int(minimum / incr - 1) * incr;
else minimum = int(minimum / incr) * incr;
if maximum < 0 then maximum = (int(maximum / incr)) * incr;
else maximum = (int(maximum / incr) +1) * incr;
%mend scale;
However, there may be some light at the end of the tunnel (and I don't mean
the train). When I was in Orlando for SUGI 20, I was asked to speak with
the SAS/GRAPH developers. It appears that they were designing significant
enhancements for Version 7. After I returned to Australia, I forwarded
copious amounts of explanations and examples of my experiences to them for
consideration. I don't know how much, if any, of my comments will be taken
into account, but I got the impression that a major effort was being put in
to the next release to meet real world conditions.
In the meantime, you could e-mail me direct if you require any further
details of the various issues that I have faced.
Ron McKean