Mercurial > hg > aim92
comparison glib/axes.h @ 0:5242703e91d3 tip
Initial checkin for AIM92 aimR8.2 (last updated May 1997).
author | tomwalters |
---|---|
date | Fri, 20 May 2011 15:19:45 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:5242703e91d3 |
---|---|
1 static char *axes_postscript[] = { | |
2 "%! simple postscript axes", | |
3 "% @(#)axes.h 1.10 John holdsworth 5/31/91", | |
4 "", | |
5 "/Axes { % title xmin xmax xtitle ymin ymax ytitle Axes -", | |
6 "/AxesDict 50 dict def", | |
7 "AxesDict begin", | |
8 "", | |
9 " /ytitle exch def", | |
10 " /ymax exch def", | |
11 " /ymin exch def", | |
12 " /xtitle exch def", | |
13 " /xmax exch def", | |
14 " /xmin exch def", | |
15 " /title exch def", | |
16 "", | |
17 " newpath clippath pathbbox /height exch def", | |
18 " /width exch def", | |
19 " pop pop", | |
20 "", | |
21 " /tagsize 0.05 height mul neg def", | |
22 " /fontsize 0.05 height mul def", | |
23 " /space 0.10 height mul def", | |
24 "", | |
25 " /Times-Roman findfont fontsize scalefont setfont", | |
26 "", | |
27 " /midprint { % str x y midprint -", | |
28 " moveto", | |
29 " dup", | |
30 " stringwidth pop 2 div neg 0 rmoveto", | |
31 " show", | |
32 " } def", | |
33 "", | |
34 " /leftprint { % str x y leftprint -", | |
35 " moveto", | |
36 " dup", | |
37 " stringwidth pop neg fontsize 0.4 mul neg rmoveto", | |
38 " show", | |
39 " } def", | |
40 "", | |
41 " /ticks { % min max ticker -", | |
42 " /ticker exch def % procedure to draw ticks", | |
43 " /max exch cvr def % axis maximum", | |
44 " /min exch cvr def % axis minimum", | |
45 "", | |
46 " /maxsubticks 50 def", | |
47 "", | |
48 " max min ne {", | |
49 "", | |
50 " % calculate order of magnitude", | |
51 "", | |
52 " /delta max min sub log ceiling 1 sub 10 exch exp def", | |
53 "", | |
54 " % do ticks", | |
55 "", | |
56 " min delta div ceiling delta mul", | |
57 " delta", | |
58 " max delta div floor delta mul", | |
59 " {", | |
60 " min sub max min sub div 0.5 exch ticker", | |
61 " }", | |
62 " for", | |
63 "", | |
64 " % do sub ticks", | |
65 "", | |
66 " max min sub delta div dup", | |
67 " 10 mul maxsubticks lt {.1} {5 mul maxsubticks lt {.2} {.5} ifelse } ifelse", | |
68 " delta mul /delta exch def", | |
69 "", | |
70 " min delta div ceiling delta mul", | |
71 " delta", | |
72 " max delta div floor delta mul", | |
73 " {", | |
74 " min sub max min sub div 0.25 exch ticker", | |
75 " }", | |
76 " for", | |
77 "", | |
78 " } if", | |
79 "", | |
80 " } def", | |
81 "", | |
82 " width 0.20 mul 0.15 height mul translate 0.75 0.75 scale", | |
83 "", | |
84 " gsave", | |
85 "", | |
86 " height 0.002 mul setlinewidth", | |
87 " currentlinewidth 2 div neg dup translate", | |
88 "", | |
89 " newpath", | |
90 " tagsize 0 moveto width 0 lineto width tagsize lineto", | |
91 " tagsize height moveto 0 height lineto 0 tagsize lineto", | |
92 " stroke", | |
93 "", | |
94 "", | |
95 " title width 2 div height tagsize sub midprint", | |
96 "", | |
97 " xmin 0 tagsize fontsize sub midprint", | |
98 " xmax width tagsize fontsize sub midprint", | |
99 "", | |
100 " 0 height moveto width height lineto width 0 lineto stroke", | |
101 "", | |
102 " xmin xmax {width mul 0 moveto tagsize mul 0 exch rlineto stroke} ticks", | |
103 " xmin xmax {width mul height moveto tagsize neg mul 0 exch rlineto stroke} ticks", | |
104 "", | |
105 " xtitle width 2 div tagsize fontsize sub midprint", | |
106 "", | |
107 "", | |
108 " ymin tagsize 0 leftprint", | |
109 " ymax tagsize height leftprint", | |
110 "", | |
111 " ymin ymax {height mul 0 exch moveto tagsize mul 0 rlineto stroke} ticks", | |
112 " ymin ymax {height mul width exch moveto tagsize neg mul 0 rlineto stroke} ticks", | |
113 "", | |
114 " 90 rotate", | |
115 " ytitle height 2 div space midprint", | |
116 "", | |
117 "", | |
118 " grestore", | |
119 "", | |
120 " newpath 0 0 moveto width 0 lineto width height lineto 0 height lineto closepath clip", | |
121 "", | |
122 "end } def", | |
123 ( char * ) 0 } ; |