summaryrefslogtreecommitdiffstats
path: root/grapheps.ps
diff options
context:
space:
mode:
authorThomas Bushnell, BSG <tb@debian.org>2006-10-23 23:55:08 -0700
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:37 -0800
commit97fc07b2d8896b869db55827900f24e6528a9bd6 (patch)
tree262ed5c19ad83dd59aac33d2e04ace4fbd94bd3b /grapheps.ps
parent810b08c931e958fdaa6971b2ce8c5e578130d652 (diff)
parent5bea21e81ed516440e34e480f2c33ca41aa8c597 (diff)
downloadslib-97fc07b2d8896b869db55827900f24e6528a9bd6.tar.gz
slib-97fc07b2d8896b869db55827900f24e6528a9bd6.zip
Import Debian changes 3a4-1debian/3a4-1
slib (3a4-1) unstable; urgency=low * New upstream release. * slib.texi (Library Catalogs): Repeat change from 3a3-3. * Makefile: Repeat $(htmldir)slib_toc.html changes from 3a2-1.
Diffstat (limited to 'grapheps.ps')
-rw-r--r--grapheps.ps18
1 files changed, 11 insertions, 7 deletions
diff --git a/grapheps.ps b/grapheps.ps
index 95f200e..db3b8b1 100644
--- a/grapheps.ps
+++ b/grapheps.ps
@@ -185,10 +185,12 @@ plotdict begin
/YSCL plotrect 3 get YRNG aload pop exch sub div def
/XOFF XOFF plotrect 0 get XSCL div sub def
/YOFF YOFF plotrect 1 get YSCL div sub def
- /YTSCL plotrect 3 get YRNG aload pop exch sub find-tick-scale def
- /YSTEP YTSCL 0 get 3 mod 0 eq {6} {8} ifelse 5 mul yuntrans def
- /XTSCL plotrect 2 get XRNG aload pop exch sub find-tick-scale def
- /XSTEP XTSCL 0 get 3 mod 0 eq {12} {10} ifelse 5 mul xuntrans def
+ /YTSCL plotrect 3 get YRNG aload pop exch sub abs find-tick-scale def
+ /YSTEP YTSCL 0 get 3 mod 0 eq {6} {8} ifelse 5 mul yuntrans
+ YSCL sign mul def
+ /XTSCL plotrect 2 get XRNG aload pop exch sub abs find-tick-scale def
+ /XSTEP XTSCL 0 get 3 mod 0 eq {12} {10} ifelse 5 mul xuntrans
+ XSCL sign mul def
/YSTEPH YSTEP 2 div def
/XSTEPH XSTEP 2 div def
} bind def
@@ -203,6 +205,8 @@ plotdict begin
/yuntrans {YTSCL aload pop exch div mul} bind def
/xuntrans {XTSCL aload pop exch div mul} bind def
+/sign {dup 0 lt {pop -1} {0 gt {1} {0} ifelse} ifelse} bind def
+
/zero-in-range? {dup 0 get 0 le exch 1 get 0 ge and} bind def
/y-axis
@@ -245,7 +249,7 @@ bind def
} bind def
% Given the width (or height) and the data-span, returns an array of
-% numerator and denominator (NUM DEN)
+% numerator and denominator [NUM DEN]
%
% NUM will be 1, 2, 3, 4, 5, 6, or 8 times a power of ten.
% DEN will be a power of ten.
@@ -256,9 +260,9 @@ bind def
/find-tick-scale
{/DLTA exch def /ISIZ exch def
/DEN 1 def
- {DLTA ISIZ le {exit} if /DEN DEN 10 mul def /ISIZ ISIZ 10 mul def} loop
+ {DLTA abs ISIZ le {exit} if /DEN DEN 10 mul def /ISIZ ISIZ 10 mul def} loop
/NUM 1 def
- {DLTA 10 mul ISIZ ge {exit} if /NUM NUM 10 mul def /DLTA DLTA 10 mul def} loop
+ {DLTA abs 10 mul ISIZ ge {exit} if /NUM NUM 10 mul def /DLTA DLTA 10 mul def} loop
[[8 6 5 4 3 2 1] {/MAX exch def MAX DLTA mul ISIZ le {MAX exit} if} forall
NUM mul DEN]
} bind def