line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Source: /home/aplonis/Chart-EPS_graph/Chart/EPS_graph/PS.pm $ |
2
|
|
|
|
|
|
|
# $Date: 2006-08-15 $ |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Chart::EPS_graph::PS; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
7
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
709
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our ($VERSION) = '$Revision: 0.01 $' =~ m{ \$Revision: \s+ (\S+) }xm; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
3
|
my $EMPTY = q{}; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# Provide defaults. |
16
|
1
|
|
|
|
|
16
|
our %ps_defaults = ( # Perl::Critic errs about THIS pkg var! |
17
|
|
|
|
|
|
|
pg_width => 640, |
18
|
|
|
|
|
|
|
pg_height => 480, |
19
|
|
|
|
|
|
|
label_top => 'Graph Main Title Goes Here', |
20
|
|
|
|
|
|
|
label_x => 'X Axis Measure (_units) Goes Here', |
21
|
|
|
|
|
|
|
label_x_2 => $EMPTY, |
22
|
|
|
|
|
|
|
label_y1 => 'Y1 Axis Measure & (_units) Goes Here', |
23
|
|
|
|
|
|
|
label_y1_2 => $EMPTY, |
24
|
|
|
|
|
|
|
label_y2 => 'Y2 Axis Measure (_units) Goes Here', |
25
|
|
|
|
|
|
|
label_y2_2 => $EMPTY, |
26
|
|
|
|
|
|
|
bg_color => 'Silver', |
27
|
|
|
|
|
|
|
fg_color => 'Black', |
28
|
|
|
|
|
|
|
web_colors => [ |
29
|
|
|
|
|
|
|
'Red', 'Gold', 'Blue', |
30
|
|
|
|
|
|
|
'Crimson', 'GoldenRod', 'BlueViolet', |
31
|
|
|
|
|
|
|
'FireBrick', 'DarkGoldenRod', 'Navy', |
32
|
|
|
|
|
|
|
], |
33
|
|
|
|
|
|
|
font_name => 'Helvetica', |
34
|
|
|
|
|
|
|
font_size => 10, |
35
|
|
|
|
|
|
|
label_x_proc => $EMPTY, |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
3
|
our $ps_web_colors_dict = <<'EOHD'; # Perl::Critic errs about THIS pkg var! |
39
|
|
|
|
|
|
|
% Color names that are supported by most browsers |
40
|
|
|
|
|
|
|
% Ref (http://www.w3schools.com/html/html_colornames.asp) |
41
|
|
|
|
|
|
|
/web_colors_dict 143 dict def |
42
|
|
|
|
|
|
|
web_colors_dict begin |
43
|
|
|
|
|
|
|
/AliceBlue { 16#F0 16#F8 16#FF } def |
44
|
|
|
|
|
|
|
/AntiqueWhite { 16#FA 16#EB 16#D7 } def |
45
|
|
|
|
|
|
|
/Aqua { 16#00 16#FF 16#FF } def |
46
|
|
|
|
|
|
|
/Aquamarine { 16#7F 16#FF 16#D4 } def |
47
|
|
|
|
|
|
|
/Azure { 16#F0 16#FF 16#FF } def |
48
|
|
|
|
|
|
|
/Beige { 16#F5 16#F5 16#DC } def |
49
|
|
|
|
|
|
|
/Bisque { 16#FF 16#E4 16#C4 } def |
50
|
|
|
|
|
|
|
/Black { 16#00 16#00 16#00 } def |
51
|
|
|
|
|
|
|
/BlanchedAlmond { 16#FF 16#EB 16#CD } def |
52
|
|
|
|
|
|
|
/Blue { 16#00 16#00 16#FF } def |
53
|
|
|
|
|
|
|
/BlueViolet { 16#8A 16#2B 16#E2 } def |
54
|
|
|
|
|
|
|
/Brown { 16#A5 16#2A 16#2A } def |
55
|
|
|
|
|
|
|
/BurlyWood { 16#DE 16#B8 16#87 } def |
56
|
|
|
|
|
|
|
/CadetBlue { 16#5F 16#9E 16#A0 } def |
57
|
|
|
|
|
|
|
/Chartreuse { 16#7F 16#FF 16#00 } def |
58
|
|
|
|
|
|
|
/Chocolate { 16#D2 16#69 16#1E } def |
59
|
|
|
|
|
|
|
/Coral { 16#FF 16#7F 16#50 } def |
60
|
|
|
|
|
|
|
/CornflowerBlue { 16#64 16#95 16#ED } def |
61
|
|
|
|
|
|
|
/Cornsilk { 16#FF 16#F8 16#DC } def |
62
|
|
|
|
|
|
|
/Crimson { 16#DC 16#14 16#3C } def |
63
|
|
|
|
|
|
|
/Cyan { 16#00 16#FF 16#FF } def |
64
|
|
|
|
|
|
|
/DarkBlue { 16#00 16#00 16#8B } def |
65
|
|
|
|
|
|
|
/DarkCyan { 16#00 16#8B 16#8B } def |
66
|
|
|
|
|
|
|
/DarkGoldenRod { 16#B8 16#86 16#0B } def |
67
|
|
|
|
|
|
|
/DarkGray { 16#A9 16#A9 16#A9 } def |
68
|
|
|
|
|
|
|
/DarkGreen { 16#00 16#64 16#00 } def |
69
|
|
|
|
|
|
|
/DarkKhaki { 16#BD 16#B7 16#6B } def |
70
|
|
|
|
|
|
|
/DarkMagenta { 16#8B 16#00 16#8B } def |
71
|
|
|
|
|
|
|
/DarkOliveGreen { 16#55 16#6B 16#2F } def |
72
|
|
|
|
|
|
|
/Darkorange { 16#FF 16#8C 16#00 } def |
73
|
|
|
|
|
|
|
/DarkOrchid { 16#99 16#32 16#CC } def |
74
|
|
|
|
|
|
|
/DarkRed { 16#8B 16#00 16#00 } def |
75
|
|
|
|
|
|
|
/DarkSalmon { 16#E9 16#96 16#7A } def |
76
|
|
|
|
|
|
|
/DarkSeaGreen { 16#8F 16#BC 16#8F } def |
77
|
|
|
|
|
|
|
/DarkSlateBlue { 16#48 16#3D 16#8B } def |
78
|
|
|
|
|
|
|
/DarkSlateGray { 16#2F 16#4F 16#4F } def |
79
|
|
|
|
|
|
|
/DarkTurquoise { 16#00 16#CE 16#D1 } def |
80
|
|
|
|
|
|
|
/DarkViolet { 16#94 16#00 16#D3 } def |
81
|
|
|
|
|
|
|
/DeepPink { 16#FF 16#14 16#93 } def |
82
|
|
|
|
|
|
|
/DeepSkyBlue { 16#00 16#BF 16#FF } def |
83
|
|
|
|
|
|
|
/DimGray { 16#69 16#69 16#69 } def |
84
|
|
|
|
|
|
|
/DodgerBlue { 16#1E 16#90 16#FF } def |
85
|
|
|
|
|
|
|
/Feldspar { 16#D1 16#92 16#75 } def |
86
|
|
|
|
|
|
|
/FireBrick { 16#B2 16#22 16#22 } def |
87
|
|
|
|
|
|
|
/FloralWhite { 16#FF 16#FA 16#F0 } def |
88
|
|
|
|
|
|
|
/ForestGreen { 16#22 16#8B 16#22 } def |
89
|
|
|
|
|
|
|
/Fuchsia { 16#FF 16#00 16#FF } def |
90
|
|
|
|
|
|
|
/Gainsboro { 16#DC 16#DC 16#DC } def |
91
|
|
|
|
|
|
|
/GhostWhite { 16#F8 16#F8 16#FF } def |
92
|
|
|
|
|
|
|
/Gold { 16#FF 16#D7 16#00 } def |
93
|
|
|
|
|
|
|
/GoldenRod { 16#DA 16#A5 16#20 } def |
94
|
|
|
|
|
|
|
/Gray { 16#80 16#80 16#80 } def |
95
|
|
|
|
|
|
|
/Green { 16#00 16#80 16#00 } def |
96
|
|
|
|
|
|
|
/GreenYellow { 16#AD 16#FF 16#2F } def |
97
|
|
|
|
|
|
|
/HoneyDew { 16#F0 16#FF 16#F0 } def |
98
|
|
|
|
|
|
|
/HotPink { 16#FF 16#69 16#B4 } def |
99
|
|
|
|
|
|
|
/IndianRed { 16#CD 16#5C 16#5C } def |
100
|
|
|
|
|
|
|
/Indigo { 16#4B 16#00 16#82 } def |
101
|
|
|
|
|
|
|
/Ivory { 16#FF 16#FF 16#F0 } def |
102
|
|
|
|
|
|
|
/Khaki { 16#F0 16#E6 16#8C } def |
103
|
|
|
|
|
|
|
/Lavender { 16#E6 16#E6 16#FA } def |
104
|
|
|
|
|
|
|
/LavenderBlush { 16#FF 16#F0 16#F5 } def |
105
|
|
|
|
|
|
|
/LawnGreen { 16#7C 16#FC 16#00 } def |
106
|
|
|
|
|
|
|
/LemonChiffon { 16#FF 16#FA 16#CD } def |
107
|
|
|
|
|
|
|
/LightBlue { 16#AD 16#D8 16#E6 } def |
108
|
|
|
|
|
|
|
/LightCoral { 16#F0 16#80 16#80 } def |
109
|
|
|
|
|
|
|
/LightCyan { 16#E0 16#FF 16#FF } def |
110
|
|
|
|
|
|
|
/LightGoldenRodYellow { 16#FA 16#FA 16#D2 } def |
111
|
|
|
|
|
|
|
/LightGrey { 16#D3 16#D3 16#D3 } def |
112
|
|
|
|
|
|
|
/LightGreen { 16#90 16#EE 16#90 } def |
113
|
|
|
|
|
|
|
/LightPink { 16#FF 16#B6 16#C1 } def |
114
|
|
|
|
|
|
|
/LightSalmon { 16#FF 16#A0 16#7A } def |
115
|
|
|
|
|
|
|
/LightSeaGreen { 16#20 16#B2 16#AA } def |
116
|
|
|
|
|
|
|
/LightSkyBlue { 16#87 16#CE 16#FA } def |
117
|
|
|
|
|
|
|
/LightSlateBlue { 16#84 16#70 16#FF } def |
118
|
|
|
|
|
|
|
/LightSlateGray { 16#77 16#88 16#99 } def |
119
|
|
|
|
|
|
|
/LightSteelBlue { 16#B0 16#C4 16#DE } def |
120
|
|
|
|
|
|
|
/LightYellow { 16#FF 16#FF 16#E0 } def |
121
|
|
|
|
|
|
|
/Lime { 16#00 16#FF 16#00 } def |
122
|
|
|
|
|
|
|
/LimeGreen { 16#32 16#CD 16#32 } def |
123
|
|
|
|
|
|
|
/Linen { 16#FA 16#F0 16#E6 } def |
124
|
|
|
|
|
|
|
/Magenta { 16#FF 16#00 16#FF } def |
125
|
|
|
|
|
|
|
/Maroon { 16#80 16#00 16#00 } def |
126
|
|
|
|
|
|
|
/MediumAquaMarine { 16#66 16#CD 16#AA } def |
127
|
|
|
|
|
|
|
/MediumBlue { 16#00 16#00 16#CD } def |
128
|
|
|
|
|
|
|
/MediumOrchid { 16#BA 16#55 16#D3 } def |
129
|
|
|
|
|
|
|
/MediumPurple { 16#93 16#70 16#D8 } def |
130
|
|
|
|
|
|
|
/MediumSeaGreen { 16#3C 16#B3 16#71 } def |
131
|
|
|
|
|
|
|
/MediumSlateBlue { 16#7B 16#68 16#EE } def |
132
|
|
|
|
|
|
|
/MediumSpringGreen { 16#00 16#FA 16#9A } def |
133
|
|
|
|
|
|
|
/MediumTurquoise { 16#48 16#D1 16#CC } def |
134
|
|
|
|
|
|
|
/MediumVioletRed { 16#C7 16#15 16#85 } def |
135
|
|
|
|
|
|
|
/MidnightBlue { 16#19 16#19 16#70 } def |
136
|
|
|
|
|
|
|
/MintCream { 16#F5 16#FF 16#FA } def |
137
|
|
|
|
|
|
|
/MistyRose { 16#FF 16#E4 16#E1 } def |
138
|
|
|
|
|
|
|
/Moccasin { 16#FF 16#E4 16#B5 } def |
139
|
|
|
|
|
|
|
/NavajoWhite { 16#FF 16#DE 16#AD } def |
140
|
|
|
|
|
|
|
/Navy { 16#00 16#00 16#80 } def |
141
|
|
|
|
|
|
|
/OldLace { 16#FD 16#F5 16#E6 } def |
142
|
|
|
|
|
|
|
/Olive { 16#80 16#80 16#00 } def |
143
|
|
|
|
|
|
|
/OliveDrab { 16#6B 16#8E 16#23 } def |
144
|
|
|
|
|
|
|
/Orange { 16#FF 16#A5 16#00 } def |
145
|
|
|
|
|
|
|
/OrangeRed { 16#FF 16#45 16#00 } def |
146
|
|
|
|
|
|
|
/Orchid { 16#DA 16#70 16#D6 } def |
147
|
|
|
|
|
|
|
/PaleGoldenRod { 16#EE 16#E8 16#AA } def |
148
|
|
|
|
|
|
|
/PaleGreen { 16#98 16#FB 16#98 } def |
149
|
|
|
|
|
|
|
/PaleTurquoise { 16#AF 16#EE 16#EE } def |
150
|
|
|
|
|
|
|
/PaleVioletRed { 16#D8 16#70 16#93 } def |
151
|
|
|
|
|
|
|
/PapayaWhip { 16#FF 16#EF 16#D5 } def |
152
|
|
|
|
|
|
|
/PeachPuff { 16#FF 16#DA 16#B9 } def |
153
|
|
|
|
|
|
|
/Peru { 16#CD 16#85 16#3F } def |
154
|
|
|
|
|
|
|
/Pink { 16#FF 16#C0 16#CB } def |
155
|
|
|
|
|
|
|
/Plum { 16#DD 16#A0 16#DD } def |
156
|
|
|
|
|
|
|
/PowderBlue { 16#B0 16#E0 16#E6 } def |
157
|
|
|
|
|
|
|
/Purple { 16#80 16#00 16#80 } def |
158
|
|
|
|
|
|
|
/Red { 16#FF 16#00 16#00 } def |
159
|
|
|
|
|
|
|
/RosyBrown { 16#BC 16#8F 16#8F } def |
160
|
|
|
|
|
|
|
/RoyalBlue { 16#41 16#69 16#E1 } def |
161
|
|
|
|
|
|
|
/SaddleBrown { 16#8B 16#45 16#13 } def |
162
|
|
|
|
|
|
|
/Salmon { 16#FA 16#80 16#72 } def |
163
|
|
|
|
|
|
|
/SandyBrown { 16#F4 16#A4 16#60 } def |
164
|
|
|
|
|
|
|
/SeaGreen { 16#2E 16#8B 16#57 } def |
165
|
|
|
|
|
|
|
/SeaShell { 16#FF 16#F5 16#EE } def |
166
|
|
|
|
|
|
|
/Sienna { 16#A0 16#52 16#2D } def |
167
|
|
|
|
|
|
|
/Silver { 16#C0 16#C0 16#C0 } def |
168
|
|
|
|
|
|
|
/SkyBlue { 16#87 16#CE 16#EB } def |
169
|
|
|
|
|
|
|
/SlateBlue { 16#6A 16#5A 16#CD } def |
170
|
|
|
|
|
|
|
/SlateGray { 16#70 16#80 16#90 } def |
171
|
|
|
|
|
|
|
/Snow { 16#FF 16#FA 16#FA } def |
172
|
|
|
|
|
|
|
/SpringGreen { 16#00 16#FF 16#7F } def |
173
|
|
|
|
|
|
|
/SteelBlue { 16#46 16#82 16#B4 } def |
174
|
|
|
|
|
|
|
/Tan { 16#D2 16#B4 16#8C } def |
175
|
|
|
|
|
|
|
/Teal { 16#00 16#80 16#80 } def |
176
|
|
|
|
|
|
|
/Thistle { 16#D8 16#BF 16#D8 } def |
177
|
|
|
|
|
|
|
/Tomato { 16#FF 16#63 16#47 } def |
178
|
|
|
|
|
|
|
/Turquoise { 16#40 16#E0 16#D0 } def |
179
|
|
|
|
|
|
|
/Violet { 16#EE 16#82 16#EE } def |
180
|
|
|
|
|
|
|
/VioletRed { 16#D0 16#20 16#90 } def |
181
|
|
|
|
|
|
|
/Wheat { 16#F5 16#DE 16#B3 } def |
182
|
|
|
|
|
|
|
/White { 16#FF 16#FF 16#FF } def |
183
|
|
|
|
|
|
|
/WhiteSmoke { 16#F5 16#F5 16#F5 } def |
184
|
|
|
|
|
|
|
/Yellow { 16#FF 16#FF 16#00 } def |
185
|
|
|
|
|
|
|
/YellowGreen { 16#9A 16#CD 16#32 } def |
186
|
|
|
|
|
|
|
% end |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
EOHD |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
|
191
|
1
|
|
|
|
|
2
|
our $ps_header = <<'EOHD'; # Perl::Critic errs about THIS pkg var! |
192
|
|
|
|
|
|
|
%!PS-Adobe-2.0 EPSF-2.0 |
193
|
|
|
|
|
|
|
%%Title: |
194
|
|
|
|
|
|
|
%%Version: (2006-08-05) |
195
|
|
|
|
|
|
|
%%Copyright: (Gan Uesli Starling) |
196
|
|
|
|
|
|
|
%%For: (Perl Module Chart::EPS_graph version 1.00) |
197
|
|
|
|
|
|
|
%%BoundingBox: |
198
|
|
|
|
|
|
|
%%DocumentResources: |
199
|
|
|
|
|
|
|
%%EndComments |
200
|
|
|
|
|
|
|
%%BeginProlog |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
EOHD |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
|
205
|
1
|
|
|
|
|
3
|
our $ps_prolog_generic = <<'EOHD'; # Perl::Critic errs about THIS pkg var! |
206
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
207
|
|
|
|
|
|
|
%% BEGIN Generic PROLOG %% |
208
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
/GraphDict 100 dict def |
211
|
|
|
|
|
|
|
GraphDict begin |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
/in { 72 mul } def |
214
|
|
|
|
|
|
|
/mm { 25.399 div 72 mul } def |
215
|
|
|
|
|
|
|
/in2pts { 72 div } def |
216
|
|
|
|
|
|
|
/mm2pts { 72 div 25.399 mul } def |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
/moveto_old /moveto load def |
219
|
|
|
|
|
|
|
/lineto_old /lineto load def |
220
|
|
|
|
|
|
|
/curveto_old /curveto load def |
221
|
|
|
|
|
|
|
/rmoveto_old /rmoveto load def |
222
|
|
|
|
|
|
|
/rlineto_old /rlineto load def |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
/moveto { |
225
|
|
|
|
|
|
|
transform round exch round exch itransform moveto_old |
226
|
|
|
|
|
|
|
} bind def |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
/lineto { |
229
|
|
|
|
|
|
|
transform round exch round exch itransform lineto_old |
230
|
|
|
|
|
|
|
} bind def |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
/rmoveto { |
233
|
|
|
|
|
|
|
currentpoint 3 -1 roll add 3 1 roll add exch |
234
|
|
|
|
|
|
|
transform round exch round exch itransform moveto_old |
235
|
|
|
|
|
|
|
} bind def |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
/rlineto { |
238
|
|
|
|
|
|
|
currentpoint 3 -1 roll add 3 1 roll add exch |
239
|
|
|
|
|
|
|
transform round exch round exch itransform lineto_old |
240
|
|
|
|
|
|
|
} bind def |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
/curveto |
243
|
|
|
|
|
|
|
{ transform round exch round exch itransform 6 2 roll |
244
|
|
|
|
|
|
|
transform round exch round exch itransform 6 2 roll |
245
|
|
|
|
|
|
|
transform round exch round exch itransform 6 2 roll curveto_old |
246
|
|
|
|
|
|
|
} bind def |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
% Divide by almost-zero when given zero. |
249
|
|
|
|
|
|
|
/div { dup 0 eq {pop 1.0e-32} if div } bind def |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
/p { print } def |
252
|
|
|
|
|
|
|
/pf { print flush } bind def |
253
|
|
|
|
|
|
|
/xor { 1 index and not and } def |
254
|
|
|
|
|
|
|
/fix { currentfile closefile clear erasepage } def |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
% BREAK POINT Loops for %stdin ( str -- ) |
257
|
|
|
|
|
|
|
/bp { |
258
|
|
|
|
|
|
|
(<<< ) p p ( >>>\n\n) pf |
259
|
|
|
|
|
|
|
pstack flush |
260
|
|
|
|
|
|
|
{ (%stdin)(r)file 32 string readline |
261
|
|
|
|
|
|
|
{ pop exit } if |
262
|
|
|
|
|
|
|
}loop |
263
|
|
|
|
|
|
|
}def |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
/showDot { (.) pf } bind def |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
% Modified from "Don Lancaster's PostScript Secrets", page 11, item 3. |
268
|
|
|
|
|
|
|
/delta_xy { % ( str -- r ) |
269
|
|
|
|
|
|
|
gsave |
270
|
|
|
|
|
|
|
nulldevice 0 0 moveto |
271
|
|
|
|
|
|
|
dup type (stringtype) eq |
272
|
|
|
|
|
|
|
{ show }{ cvx exec } ifelse |
273
|
|
|
|
|
|
|
currentpoint |
274
|
|
|
|
|
|
|
grestore |
275
|
|
|
|
|
|
|
} def |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
/center_show { |
278
|
|
|
|
|
|
|
dup delta_xy pop |
279
|
|
|
|
|
|
|
-2 div 0 rmoveto |
280
|
|
|
|
|
|
|
dup type |
281
|
|
|
|
|
|
|
(stringtype) eq { show }{ cvx exec } ifelse |
282
|
|
|
|
|
|
|
} def |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
/center_show_resized { % ( str/proc r -- ) |
285
|
|
|
|
|
|
|
/max_width exch def |
286
|
|
|
|
|
|
|
dup delta_xy pop /real_width exch def |
287
|
|
|
|
|
|
|
real_width max_width gt { |
288
|
|
|
|
|
|
|
font_name findfont |
289
|
|
|
|
|
|
|
max_width real_width div font_size mul scalefont |
290
|
|
|
|
|
|
|
setfont |
291
|
|
|
|
|
|
|
center_show |
292
|
|
|
|
|
|
|
font_name findfont font_size scalefont setfont |
293
|
|
|
|
|
|
|
} |
294
|
|
|
|
|
|
|
{ center_show |
295
|
|
|
|
|
|
|
} ifelse |
296
|
|
|
|
|
|
|
} def |
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
/align_center { |
299
|
|
|
|
|
|
|
gsave |
300
|
|
|
|
|
|
|
nulldevice |
301
|
|
|
|
|
|
|
currentpoint pop |
302
|
|
|
|
|
|
|
exch show |
303
|
|
|
|
|
|
|
currentpoint pop sub |
304
|
|
|
|
|
|
|
grestore |
305
|
|
|
|
|
|
|
.5 mul 0 rmoveto |
306
|
|
|
|
|
|
|
} def |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
/align_y2 { |
309
|
|
|
|
|
|
|
gsave |
310
|
|
|
|
|
|
|
nulldevice |
311
|
|
|
|
|
|
|
currentpoint pop |
312
|
|
|
|
|
|
|
exch show |
313
|
|
|
|
|
|
|
currentpoint pop sub |
314
|
|
|
|
|
|
|
grestore |
315
|
|
|
|
|
|
|
0 rmoveto |
316
|
|
|
|
|
|
|
} def |
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
/round_off { |
319
|
|
|
|
|
|
|
dup ceiling cvi 32 string cvs |
320
|
|
|
|
|
|
|
length |
321
|
|
|
|
|
|
|
dup 3 ge { 0 exch } if |
322
|
|
|
|
|
|
|
dup 2 eq { 1 exch } if |
323
|
|
|
|
|
|
|
dup 1 eq { 2 exch } if |
324
|
|
|
|
|
|
|
pop |
325
|
|
|
|
|
|
|
dup 0 eq { pop cvi }{ |
326
|
|
|
|
|
|
|
exch 1 index { 10 mul } repeat |
327
|
|
|
|
|
|
|
round |
328
|
|
|
|
|
|
|
exch { 10 div } repeat |
329
|
|
|
|
|
|
|
} ifelse |
330
|
|
|
|
|
|
|
} def |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
/inc_value { dup cvx exec 1 add def } def |
333
|
|
|
|
|
|
|
/dec_value { dup cvx exec 1 sub def } def |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
/splice_asn { |
336
|
|
|
|
|
|
|
exch |
337
|
|
|
|
|
|
|
/XXX |
338
|
|
|
|
|
|
|
2 { 2 index length } repeat |
339
|
|
|
|
|
|
|
add |
340
|
|
|
|
|
|
|
2 index type |
341
|
|
|
|
|
|
|
dup /arraytype eq { pop array def false }{ |
342
|
|
|
|
|
|
|
/nametype eq { |
343
|
|
|
|
|
|
|
string def |
344
|
|
|
|
|
|
|
32 string cvs exch |
345
|
|
|
|
|
|
|
32 string cvs exch |
346
|
|
|
|
|
|
|
true |
347
|
|
|
|
|
|
|
}{ |
348
|
|
|
|
|
|
|
string def false |
349
|
|
|
|
|
|
|
} ifelse |
350
|
|
|
|
|
|
|
} ifelse |
351
|
|
|
|
|
|
|
exch XXX |
352
|
|
|
|
|
|
|
1 index length |
353
|
|
|
|
|
|
|
5 -1 roll |
354
|
|
|
|
|
|
|
putinterval |
355
|
|
|
|
|
|
|
XXX 0 |
356
|
|
|
|
|
|
|
3 -1 roll |
357
|
|
|
|
|
|
|
putinterval |
358
|
|
|
|
|
|
|
XXX exch { cvn /XXX 1 index def } if |
359
|
|
|
|
|
|
|
} bind def |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
/splice_as_name |
362
|
|
|
|
|
|
|
{ 1 index 32 string cvs |
363
|
|
|
|
|
|
|
splice_asn cvn |
364
|
|
|
|
|
|
|
} def |
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
/tack_onto_array |
367
|
|
|
|
|
|
|
{ /tack_on 1 array def |
368
|
|
|
|
|
|
|
tack_on 0 3 -1 roll |
369
|
|
|
|
|
|
|
put |
370
|
|
|
|
|
|
|
tack_on splice_asn |
371
|
|
|
|
|
|
|
} bind def |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
/shift_array |
374
|
|
|
|
|
|
|
{ dup cvx exec |
375
|
|
|
|
|
|
|
dup length dup 0 eq |
376
|
|
|
|
|
|
|
{ |
377
|
|
|
|
|
|
|
pop pop pop false |
378
|
|
|
|
|
|
|
}{ 1 index 0 get |
379
|
|
|
|
|
|
|
4 1 roll |
380
|
|
|
|
|
|
|
dup 1 eq |
381
|
|
|
|
|
|
|
{ |
382
|
|
|
|
|
|
|
pop pop [] def |
383
|
|
|
|
|
|
|
}{ |
384
|
|
|
|
|
|
|
1 exch 1 sub |
385
|
|
|
|
|
|
|
getinterval def |
386
|
|
|
|
|
|
|
} ifelse |
387
|
|
|
|
|
|
|
true |
388
|
|
|
|
|
|
|
} ifelse |
389
|
|
|
|
|
|
|
} bind def |
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
/inc_array_elems |
392
|
|
|
|
|
|
|
{ [ exch |
393
|
|
|
|
|
|
|
{ 1 add |
394
|
|
|
|
|
|
|
} forall |
395
|
|
|
|
|
|
|
] |
396
|
|
|
|
|
|
|
} def |
397
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
/dec_array_elems |
399
|
|
|
|
|
|
|
{ [ exch |
400
|
|
|
|
|
|
|
{ 1 sub |
401
|
|
|
|
|
|
|
} forall |
402
|
|
|
|
|
|
|
] |
403
|
|
|
|
|
|
|
} def |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%% |
406
|
|
|
|
|
|
|
%% END Generic PROLOG %% |
407
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%% |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
EOHD |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
|
412
|
1
|
|
|
|
|
2
|
our $ps_prolog_graphing = <<'EOHD'; # Perl::Critic errs about THIS pkg var! |
413
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
414
|
|
|
|
|
|
|
%% BEGIN Graphing PROLOG %% |
415
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
416
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
/thin { 0.20 setlinewidth } def |
418
|
|
|
|
|
|
|
/thick { 0.60 setlinewidth } def |
419
|
|
|
|
|
|
|
/thicker { 1.00 setlinewidth } def |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
/bg_line_edge { |
422
|
|
|
|
|
|
|
gsave |
423
|
|
|
|
|
|
|
currentlinewidth 1.8 mul setlinewidth |
424
|
|
|
|
|
|
|
bg_color cvx exec set_color_rgb exec |
425
|
|
|
|
|
|
|
[ ] 0 setdash |
426
|
|
|
|
|
|
|
stroke |
427
|
|
|
|
|
|
|
grestore |
428
|
|
|
|
|
|
|
} def |
429
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
/show_curve_id { |
431
|
|
|
|
|
|
|
/id_size font_size 0.8 mul def |
432
|
|
|
|
|
|
|
gsave |
433
|
|
|
|
|
|
|
fg_color cvx exec set_color_rgb exec |
434
|
|
|
|
|
|
|
show_x show_y id_size 10 div sub moveto currentpoint |
435
|
|
|
|
|
|
|
/Symbol findfont id_size scalefont setfont |
436
|
|
|
|
|
|
|
id_point_char align_center |
437
|
|
|
|
|
|
|
id_point_char true charpath |
438
|
|
|
|
|
|
|
gsave |
439
|
|
|
|
|
|
|
bg_color cvx exec set_color_rgb exec |
440
|
|
|
|
|
|
|
4 setlinewidth |
441
|
|
|
|
|
|
|
stroke |
442
|
|
|
|
|
|
|
grestore |
443
|
|
|
|
|
|
|
gsave |
444
|
|
|
|
|
|
|
line_color exec fill |
445
|
|
|
|
|
|
|
grestore |
446
|
|
|
|
|
|
|
moveto |
447
|
|
|
|
|
|
|
0 id_size -0.8 mul rmoveto |
448
|
|
|
|
|
|
|
segregate? { |
449
|
|
|
|
|
|
|
y2? { ( \256)}{ ( \254)} ifelse |
450
|
|
|
|
|
|
|
dup align_center |
451
|
|
|
|
|
|
|
true charpath |
452
|
|
|
|
|
|
|
gsave |
453
|
|
|
|
|
|
|
bg_color cvx exec set_color_rgb exec |
454
|
|
|
|
|
|
|
4 setlinewidth |
455
|
|
|
|
|
|
|
stroke |
456
|
|
|
|
|
|
|
grestore |
457
|
|
|
|
|
|
|
line_color exec fill |
458
|
|
|
|
|
|
|
} if |
459
|
|
|
|
|
|
|
grestore |
460
|
|
|
|
|
|
|
} def |
461
|
|
|
|
|
|
|
|
462
|
|
|
|
|
|
|
% BELL & WHISTLE. USED TO DISPLAY DATA SET AND CURVE NUMBERS ON THE GRAPH. |
463
|
|
|
|
|
|
|
/id_point_space { h_length 3 div } def |
464
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
% Show an ID char for reach curve. |
466
|
|
|
|
|
|
|
/id_point { |
467
|
|
|
|
|
|
|
/y exch def /x exch def |
468
|
|
|
|
|
|
|
x id_point_space |
469
|
|
|
|
|
|
|
show_y 0 eq { 2 div } if |
470
|
|
|
|
|
|
|
sub |
471
|
|
|
|
|
|
|
show_x gt { |
472
|
|
|
|
|
|
|
show_curve_id_x x |
473
|
|
|
|
|
|
|
tack_onto_array |
474
|
|
|
|
|
|
|
/show_curve_id_x exch def |
475
|
|
|
|
|
|
|
show_curve_id_y y |
476
|
|
|
|
|
|
|
tack_onto_array |
477
|
|
|
|
|
|
|
/show_curve_id_y exch def |
478
|
|
|
|
|
|
|
/show_x x def |
479
|
|
|
|
|
|
|
/show_y y def |
480
|
|
|
|
|
|
|
} if |
481
|
|
|
|
|
|
|
} bind def |
482
|
|
|
|
|
|
|
|
483
|
|
|
|
|
|
|
/add_tick_y2 { segregate? { 2 mm add } if } def |
484
|
|
|
|
|
|
|
/h_line_1 { h_length 0 rlineto stroke } def |
485
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
/h_line_2 { |
487
|
|
|
|
|
|
|
-2 mm 0 rmoveto |
488
|
|
|
|
|
|
|
h_length 2 mm add add_tick_y2 0 rlineto thick stroke thin |
489
|
|
|
|
|
|
|
} def |
490
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
/hLines { |
492
|
|
|
|
|
|
|
origin moveto |
493
|
|
|
|
|
|
|
thick h_line_2 thin |
494
|
|
|
|
|
|
|
/i 1 def |
495
|
|
|
|
|
|
|
v_ticks { |
496
|
|
|
|
|
|
|
origin vinc i mul add moveto h_line_1 |
497
|
|
|
|
|
|
|
origin vinc i 1 add mul add moveto h_line_2 |
498
|
|
|
|
|
|
|
/i i 2 add def |
499
|
|
|
|
|
|
|
} repeat |
500
|
|
|
|
|
|
|
} def |
501
|
|
|
|
|
|
|
|
502
|
|
|
|
|
|
|
/v_line_1 { 0 v_height rlineto stroke } def |
503
|
|
|
|
|
|
|
|
504
|
|
|
|
|
|
|
/v_line_2 { |
505
|
|
|
|
|
|
|
0 -2 mm rmoveto |
506
|
|
|
|
|
|
|
0 v_height 2 mm add rlineto thick stroke thin |
507
|
|
|
|
|
|
|
} def |
508
|
|
|
|
|
|
|
|
509
|
|
|
|
|
|
|
/vLines { |
510
|
|
|
|
|
|
|
origin moveto thick v_line_2 thin /i 1 def |
511
|
|
|
|
|
|
|
h_ticks { |
512
|
|
|
|
|
|
|
origin exch hinc i mul add exch moveto v_line_1 |
513
|
|
|
|
|
|
|
origin exch hinc i 1 add mul add exch moveto v_line_2 |
514
|
|
|
|
|
|
|
/i i 2 add def |
515
|
|
|
|
|
|
|
} repeat |
516
|
|
|
|
|
|
|
} def |
517
|
|
|
|
|
|
|
|
518
|
|
|
|
|
|
|
/h_tick_value { h_max_value h_min_value sub h_ticks div } def |
519
|
|
|
|
|
|
|
/v_tick_value { v_max_value v_min_value sub v_ticks div } def |
520
|
|
|
|
|
|
|
/v_tick_value_y2 { v_max_value_y2 v_min_value_y2 sub v_ticks div } def |
521
|
|
|
|
|
|
|
/hinc { grid_width h_ticks 2 mul div } def |
522
|
|
|
|
|
|
|
/vinc { grid_height v_ticks 2 mul div } def |
523
|
|
|
|
|
|
|
/h_length { h_ticks 2 mul hinc mul } def |
524
|
|
|
|
|
|
|
/v_height { v_ticks 2 mul vinc mul } def |
525
|
|
|
|
|
|
|
/v_units { v_tick_value div vinc mul 2 mul } def |
526
|
|
|
|
|
|
|
/v_units_y2 { v_tick_value_y2 div vinc mul 2 mul} def |
527
|
|
|
|
|
|
|
/h_units { h_tick_value div hinc mul 2 mul } def |
528
|
|
|
|
|
|
|
|
529
|
|
|
|
|
|
|
/marks_y1 { |
530
|
|
|
|
|
|
|
/i 0 def |
531
|
|
|
|
|
|
|
v_ticks -1 0 { |
532
|
|
|
|
|
|
|
origin exch 10 sub exch vinc i mul add 3 sub moveto |
533
|
|
|
|
|
|
|
gsave |
534
|
|
|
|
|
|
|
v_max_value v_tick_value 2 index mul sub |
535
|
|
|
|
|
|
|
round_off |
536
|
|
|
|
|
|
|
32 string cvs |
537
|
|
|
|
|
|
|
dup stringwidth pop neg 0 rmoveto show |
538
|
|
|
|
|
|
|
grestore |
539
|
|
|
|
|
|
|
/i i 2 add def |
540
|
|
|
|
|
|
|
} for |
541
|
|
|
|
|
|
|
pop |
542
|
|
|
|
|
|
|
gsave |
543
|
|
|
|
|
|
|
origin moveto |
544
|
|
|
|
|
|
|
90 rotate |
545
|
|
|
|
|
|
|
v_height 2 div 40 rmoveto |
546
|
|
|
|
|
|
|
currentpoint |
547
|
|
|
|
|
|
|
label_y1 v_height center_show_resized |
548
|
|
|
|
|
|
|
20 add moveto |
549
|
|
|
|
|
|
|
label_y1_2 v_height center_show_resized |
550
|
|
|
|
|
|
|
grestore |
551
|
|
|
|
|
|
|
} def |
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
/marks_y2 { |
554
|
|
|
|
|
|
|
/i 0 def |
555
|
|
|
|
|
|
|
v_ticks -1 0 { |
556
|
|
|
|
|
|
|
origin |
557
|
|
|
|
|
|
|
exch h_length add 10 add exch |
558
|
|
|
|
|
|
|
vinc i mul add 3 sub |
559
|
|
|
|
|
|
|
moveto |
560
|
|
|
|
|
|
|
gsave |
561
|
|
|
|
|
|
|
v_max_value_y2 v_tick_value_y2 2 index mul sub |
562
|
|
|
|
|
|
|
round_off |
563
|
|
|
|
|
|
|
32 string cvs |
564
|
|
|
|
|
|
|
dup show |
565
|
|
|
|
|
|
|
grestore |
566
|
|
|
|
|
|
|
/i i 2 add def |
567
|
|
|
|
|
|
|
} for |
568
|
|
|
|
|
|
|
pop |
569
|
|
|
|
|
|
|
gsave |
570
|
|
|
|
|
|
|
origin moveto |
571
|
|
|
|
|
|
|
-90 rotate |
572
|
|
|
|
|
|
|
v_height -2 div h_length 45 add rmoveto |
573
|
|
|
|
|
|
|
180 rotate |
574
|
|
|
|
|
|
|
currentpoint |
575
|
|
|
|
|
|
|
label_y2 v_height center_show_resized |
576
|
|
|
|
|
|
|
20 sub moveto |
577
|
|
|
|
|
|
|
label_y2_2 v_height center_show_resized |
578
|
|
|
|
|
|
|
grestore |
579
|
|
|
|
|
|
|
} def |
580
|
|
|
|
|
|
|
|
581
|
|
|
|
|
|
|
/marks_top { |
582
|
|
|
|
|
|
|
/i 0 def |
583
|
|
|
|
|
|
|
h_ticks -1 0 |
584
|
|
|
|
|
|
|
{ origin exch hinc i mul add 3 sub exch 10 sub moveto |
585
|
|
|
|
|
|
|
gsave |
586
|
|
|
|
|
|
|
270 rotate |
587
|
|
|
|
|
|
|
h_max_value h_tick_value 2 index mul sub |
588
|
|
|
|
|
|
|
round_off |
589
|
|
|
|
|
|
|
32 string cvs |
590
|
|
|
|
|
|
|
show |
591
|
|
|
|
|
|
|
grestore |
592
|
|
|
|
|
|
|
/i i 2 add def |
593
|
|
|
|
|
|
|
} for |
594
|
|
|
|
|
|
|
pop |
595
|
|
|
|
|
|
|
origin moveto h_length 2 div v_height 20 add rmoveto |
596
|
|
|
|
|
|
|
label_top h_length origin pop add center_show_resized |
597
|
|
|
|
|
|
|
} def |
598
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
/center_x { |
600
|
|
|
|
|
|
|
origin moveto h_length 2 div 0 rmoveto |
601
|
|
|
|
|
|
|
} def |
602
|
|
|
|
|
|
|
|
603
|
|
|
|
|
|
|
/max_width_x { pg_width 20 sub } def |
604
|
|
|
|
|
|
|
|
605
|
|
|
|
|
|
|
/marks_x { |
606
|
|
|
|
|
|
|
/i 0 def |
607
|
|
|
|
|
|
|
h_ticks -1 0 { |
608
|
|
|
|
|
|
|
origin exch hinc i mul add 3 sub exch 10 sub moveto |
609
|
|
|
|
|
|
|
gsave |
610
|
|
|
|
|
|
|
270 rotate |
611
|
|
|
|
|
|
|
h_max_value h_tick_value 2 index mul sub |
612
|
|
|
|
|
|
|
round_off |
613
|
|
|
|
|
|
|
32 string cvs |
614
|
|
|
|
|
|
|
show |
615
|
|
|
|
|
|
|
grestore |
616
|
|
|
|
|
|
|
/i i 2 add def |
617
|
|
|
|
|
|
|
} for |
618
|
|
|
|
|
|
|
pop |
619
|
|
|
|
|
|
|
center_x 0 -50 rmoveto |
620
|
|
|
|
|
|
|
label_x max_width_x center_show_resized |
621
|
|
|
|
|
|
|
center_x 0 -70 rmoveto |
622
|
|
|
|
|
|
|
/label_x_proc max_width_x center_show_resized |
623
|
|
|
|
|
|
|
label_x_2 length 0 gt { |
624
|
|
|
|
|
|
|
center_x 0 -90 rmoveto |
625
|
|
|
|
|
|
|
label_x_2 max_width_x center_show_resized |
626
|
|
|
|
|
|
|
} if |
627
|
|
|
|
|
|
|
} def |
628
|
|
|
|
|
|
|
|
629
|
|
|
|
|
|
|
/xpnt { 3 index exch exp mul } def |
630
|
|
|
|
|
|
|
|
631
|
|
|
|
|
|
|
/plot_paired_arrays { |
632
|
|
|
|
|
|
|
/show_curve_id_x [] def |
633
|
|
|
|
|
|
|
/show_curve_id_y [] def |
634
|
|
|
|
|
|
|
0 1 points_array length 1 sub { |
635
|
|
|
|
|
|
|
points_array 1 index get |
636
|
|
|
|
|
|
|
column_array-0 2 index get |
637
|
|
|
|
|
|
|
h_min_value sub exch |
638
|
|
|
|
|
|
|
v_min_value |
639
|
|
|
|
|
|
|
y2? { v_ratio_y2 div } if |
640
|
|
|
|
|
|
|
sub exch |
641
|
|
|
|
|
|
|
h_units exch |
642
|
|
|
|
|
|
|
y2? { |
643
|
|
|
|
|
|
|
v_units_y2 v_min_value_y2 v_units_y2 sub v_min_value v_units add |
644
|
|
|
|
|
|
|
}{ |
645
|
|
|
|
|
|
|
v_units |
646
|
|
|
|
|
|
|
} ifelse |
647
|
|
|
|
|
|
|
3 -1 roll 0 eq { |
648
|
|
|
|
|
|
|
2 copy moveto |
649
|
|
|
|
|
|
|
}{ |
650
|
|
|
|
|
|
|
2 copy lineto |
651
|
|
|
|
|
|
|
} ifelse |
652
|
|
|
|
|
|
|
id_point |
653
|
|
|
|
|
|
|
} for |
654
|
|
|
|
|
|
|
} bind def |
655
|
|
|
|
|
|
|
|
656
|
|
|
|
|
|
|
/plot_pairs { |
657
|
|
|
|
|
|
|
/show_x |
658
|
|
|
|
|
|
|
curve_id |
659
|
|
|
|
|
|
|
15 mul |
660
|
|
|
|
|
|
|
data_set_id 1 sub |
661
|
|
|
|
|
|
|
10 mul add |
662
|
|
|
|
|
|
|
def |
663
|
|
|
|
|
|
|
/show_y 0 def |
664
|
|
|
|
|
|
|
gsave |
665
|
|
|
|
|
|
|
origin moveto |
666
|
|
|
|
|
|
|
currentpoint translate |
667
|
|
|
|
|
|
|
plot_paired_arrays |
668
|
|
|
|
|
|
|
bg_line_edge |
669
|
|
|
|
|
|
|
stroke |
670
|
|
|
|
|
|
|
gsave |
671
|
|
|
|
|
|
|
0 1 show_curve_id_x length 1 sub |
672
|
|
|
|
|
|
|
{ show_curve_id |
673
|
|
|
|
|
|
|
show_curve_id_x 1 index get |
674
|
|
|
|
|
|
|
/show_x exch def |
675
|
|
|
|
|
|
|
show_curve_id_y exch get |
676
|
|
|
|
|
|
|
/show_y exch def |
677
|
|
|
|
|
|
|
} for |
678
|
|
|
|
|
|
|
grestore |
679
|
|
|
|
|
|
|
grestore |
680
|
|
|
|
|
|
|
} bind def |
681
|
|
|
|
|
|
|
|
682
|
|
|
|
|
|
|
/plot_lines { |
683
|
|
|
|
|
|
|
gsave |
684
|
|
|
|
|
|
|
origin moveto currentpoint translate |
685
|
|
|
|
|
|
|
0 5 x-fin { |
686
|
|
|
|
|
|
|
y.line exch mm exch mm |
687
|
|
|
|
|
|
|
dup 0 lt { pop 0 } if |
688
|
|
|
|
|
|
|
lineOp |
689
|
|
|
|
|
|
|
} for |
690
|
|
|
|
|
|
|
stroke |
691
|
|
|
|
|
|
|
grestore |
692
|
|
|
|
|
|
|
} bind def |
693
|
|
|
|
|
|
|
|
694
|
|
|
|
|
|
|
/formula { |
695
|
|
|
|
|
|
|
-194.77 250.75 2 index mul add |
696
|
|
|
|
|
|
|
.13976 2 index 2 exp mul sub |
697
|
|
|
|
|
|
|
2.2082e-2 3 xpnt sub |
698
|
|
|
|
|
|
|
1.5757e-4 4 xpnt add |
699
|
|
|
|
|
|
|
3.2312e-7 5 xpnt sub |
700
|
|
|
|
|
|
|
} def |
701
|
|
|
|
|
|
|
|
702
|
|
|
|
|
|
|
/do_curve { |
703
|
|
|
|
|
|
|
/x-fin 200 def /y.line { formula } def |
704
|
|
|
|
|
|
|
plot_pairs stroke |
705
|
|
|
|
|
|
|
} def |
706
|
|
|
|
|
|
|
|
707
|
|
|
|
|
|
|
/graph { |
708
|
|
|
|
|
|
|
font_name findfont font_size scalefont setfont |
709
|
|
|
|
|
|
|
origin moveto |
710
|
|
|
|
|
|
|
h_tick_value v_tick_value |
711
|
|
|
|
|
|
|
hLines vLines |
712
|
|
|
|
|
|
|
segregate? { marks_y2 } if |
713
|
|
|
|
|
|
|
marks_y1 marks_top marks_x |
714
|
|
|
|
|
|
|
} def |
715
|
|
|
|
|
|
|
|
716
|
|
|
|
|
|
|
/bg_color_bbox { |
717
|
|
|
|
|
|
|
0 0 moveto |
718
|
|
|
|
|
|
|
pg_width 0 lineto |
719
|
|
|
|
|
|
|
pg_width pg_height lineto |
720
|
|
|
|
|
|
|
0 pg_height lineto |
721
|
|
|
|
|
|
|
closepath |
722
|
|
|
|
|
|
|
bg_color cvx exec set_color_rgb exec |
723
|
|
|
|
|
|
|
fill |
724
|
|
|
|
|
|
|
} def |
725
|
|
|
|
|
|
|
|
726
|
|
|
|
|
|
|
/do_graph { |
727
|
|
|
|
|
|
|
/origin { 80 110 } def |
728
|
|
|
|
|
|
|
/grid_height { pg_height origin exch pop 2 mul sub 60 add } def |
729
|
|
|
|
|
|
|
/grid_width { pg_width origin pop 2 mul sub } def |
730
|
|
|
|
|
|
|
gsave |
731
|
|
|
|
|
|
|
fg_color cvx exec set_color_rgb exec |
732
|
|
|
|
|
|
|
graph |
733
|
|
|
|
|
|
|
grestore |
734
|
|
|
|
|
|
|
} def |
735
|
|
|
|
|
|
|
|
736
|
|
|
|
|
|
|
/compensate { } def % {1 1.08133 div mul} def |
737
|
|
|
|
|
|
|
|
738
|
|
|
|
|
|
|
/floor_ceiling_div 10 def |
739
|
|
|
|
|
|
|
|
740
|
|
|
|
|
|
|
/set_ceiling { |
741
|
|
|
|
|
|
|
/low_ceiling false def |
742
|
|
|
|
|
|
|
all_y_cols_max |
743
|
|
|
|
|
|
|
dup 0 gt |
744
|
|
|
|
|
|
|
1 index 1 lt and { |
745
|
|
|
|
|
|
|
floor_ceiling_div mul |
746
|
|
|
|
|
|
|
/low_ceiling true def |
747
|
|
|
|
|
|
|
} if |
748
|
|
|
|
|
|
|
ceiling |
749
|
|
|
|
|
|
|
low_ceiling { floor_ceiling_div div } if |
750
|
|
|
|
|
|
|
} def |
751
|
|
|
|
|
|
|
|
752
|
|
|
|
|
|
|
/set_floor { |
753
|
|
|
|
|
|
|
all_y_cols_min |
754
|
|
|
|
|
|
|
low_ceiling { floor_ceiling_div mul } if |
755
|
|
|
|
|
|
|
floor |
756
|
|
|
|
|
|
|
low_ceiling { floor_ceiling_div div } if |
757
|
|
|
|
|
|
|
} def |
758
|
|
|
|
|
|
|
|
759
|
|
|
|
|
|
|
/init_graph_params { |
760
|
|
|
|
|
|
|
1 setlinecap |
761
|
|
|
|
|
|
|
1 setlinejoin |
762
|
|
|
|
|
|
|
segregate? { |
763
|
|
|
|
|
|
|
segregate_y_coords |
764
|
|
|
|
|
|
|
/v_max_value set_ceiling def |
765
|
|
|
|
|
|
|
/v_min_value set_floor def |
766
|
|
|
|
|
|
|
|
767
|
|
|
|
|
|
|
% Must calculate v_ticks ahead of other functions, even if redundantly. |
768
|
|
|
|
|
|
|
exch_y_coords |
769
|
|
|
|
|
|
|
/v_max_value_y2 set_ceiling def |
770
|
|
|
|
|
|
|
/v_min_value_y2 set_floor def |
771
|
|
|
|
|
|
|
exch_y_coords |
772
|
|
|
|
|
|
|
|
773
|
|
|
|
|
|
|
/v_ticks |
774
|
|
|
|
|
|
|
v_max_value v_min_value sub |
775
|
|
|
|
|
|
|
v_max_value_y2 v_min_value_y2 sub mul |
776
|
|
|
|
|
|
|
abs cvi |
777
|
|
|
|
|
|
|
def |
778
|
|
|
|
|
|
|
|
779
|
|
|
|
|
|
|
/v_ticks 6 12 adjust_tick |
780
|
|
|
|
|
|
|
|
781
|
|
|
|
|
|
|
/v_ratio_y2 |
782
|
|
|
|
|
|
|
v_max_value v_min_value sub |
783
|
|
|
|
|
|
|
v_max_value_y2 v_min_value_y2 sub |
784
|
|
|
|
|
|
|
div |
785
|
|
|
|
|
|
|
def |
786
|
|
|
|
|
|
|
}{ |
787
|
|
|
|
|
|
|
/v_max_value set_ceiling def |
788
|
|
|
|
|
|
|
/v_min_value set_floor def |
789
|
|
|
|
|
|
|
/v_ticks v_max_value v_min_value sub abs cvi def |
790
|
|
|
|
|
|
|
/v_ticks 6 12 adjust_tick |
791
|
|
|
|
|
|
|
} ifelse |
792
|
|
|
|
|
|
|
/h_max_value |
793
|
|
|
|
|
|
|
max_max_vals 0 get |
794
|
|
|
|
|
|
|
100 mul |
795
|
|
|
|
|
|
|
ceiling round_off |
796
|
|
|
|
|
|
|
100 div |
797
|
|
|
|
|
|
|
def |
798
|
|
|
|
|
|
|
/h_min_value |
799
|
|
|
|
|
|
|
min_min_vals 0 get |
800
|
|
|
|
|
|
|
100 mul |
801
|
|
|
|
|
|
|
floor round_off |
802
|
|
|
|
|
|
|
100 div |
803
|
|
|
|
|
|
|
def |
804
|
|
|
|
|
|
|
/h_ticks h_max_value h_min_value sub 10 mul abs cvi def |
805
|
|
|
|
|
|
|
/h_ticks 9 25 adjust_tick |
806
|
|
|
|
|
|
|
segregate? { }{ /v_ratio_y2 .9999 def } ifelse |
807
|
|
|
|
|
|
|
} def |
808
|
|
|
|
|
|
|
|
809
|
|
|
|
|
|
|
% Adjust hTick or vTick to fall between 6 and 20 |
810
|
|
|
|
|
|
|
/adjust_tick { % ( /name i i -- ) |
811
|
|
|
|
|
|
|
dup |
812
|
|
|
|
|
|
|
/ticks_max exch def |
813
|
|
|
|
|
|
|
/ticks_min exch def |
814
|
|
|
|
|
|
|
% Min ticks are ticks_min. |
815
|
|
|
|
|
|
|
dup cvx exec { |
816
|
|
|
|
|
|
|
dup ticks_min ge { cvi def exit } if |
817
|
|
|
|
|
|
|
2 mul |
818
|
|
|
|
|
|
|
} loop |
819
|
|
|
|
|
|
|
% Max ticks are ticks_max. |
820
|
|
|
|
|
|
|
dup cvx exec { |
821
|
|
|
|
|
|
|
dup ticks_max le { cvi def exit } if |
822
|
|
|
|
|
|
|
2 div |
823
|
|
|
|
|
|
|
} loop |
824
|
|
|
|
|
|
|
} def |
825
|
|
|
|
|
|
|
|
826
|
|
|
|
|
|
|
/draw_one_curve { |
827
|
|
|
|
|
|
|
/points_array |
828
|
|
|
|
|
|
|
(column_array-) |
829
|
|
|
|
|
|
|
curve_id 2 string cvs splice_asn |
830
|
|
|
|
|
|
|
cvx exec def |
831
|
|
|
|
|
|
|
pick_dash_&_color |
832
|
|
|
|
|
|
|
curve_id show_this_curve? { do_curve } if |
833
|
|
|
|
|
|
|
} def |
834
|
|
|
|
|
|
|
|
835
|
|
|
|
|
|
|
/spc 2.5 def |
836
|
|
|
|
|
|
|
/dit spc 1.5 mul def |
837
|
|
|
|
|
|
|
/dah dit 3.5 mul def |
838
|
|
|
|
|
|
|
/linio dah 2.5 mul def |
839
|
|
|
|
|
|
|
|
840
|
|
|
|
|
|
|
/dash_procs |
841
|
|
|
|
|
|
|
[ { } % sans dash |
842
|
|
|
|
|
|
|
{ [ dit spc dah spc linio spc ] 0 setdash } % .- a |
843
|
|
|
|
|
|
|
{ [ dah spc dit spc dit spc dit spc linio spc ] 0 setdash } % -... b |
844
|
|
|
|
|
|
|
{ [ dah spc dit spc dah spc dit spc linio spc ] 0 setdash } % -.-. c |
845
|
|
|
|
|
|
|
{ [ dah spc dit spc dit spc linio spc ] 0 setdash } % -.. d |
846
|
|
|
|
|
|
|
{ [ dit spc linio spc ] 0 setdash } % . e |
847
|
|
|
|
|
|
|
{ [ dit spc dit spc dah spc dit spc linio spc ] 0 setdash } % ..-. f |
848
|
|
|
|
|
|
|
{ [ dah spc dah spc dit spc linio spc ] 0 setdash } % --. g |
849
|
|
|
|
|
|
|
{ [ dit spc dit spc dit spc dit spc linio spc ] 0 setdash } % .... h |
850
|
|
|
|
|
|
|
{ [ dit spc dit spc linio spc ] 0 setdash } % .. i |
851
|
|
|
|
|
|
|
{ [ dit spc dah spc dah spc dah spc linio spc ] 0 setdash } % .--- j |
852
|
|
|
|
|
|
|
{ [ dah spc dit spc dah spc linio spc ] 0 setdash } % -.- k |
853
|
|
|
|
|
|
|
{ [ dah spc dit spc dah spc dah spc linio spc ] 0 setdash } % -.-- l |
854
|
|
|
|
|
|
|
{ [ dah spc dah spc linio spc ] 0 setdash } % -- m |
855
|
|
|
|
|
|
|
{ [ dah spc dit spc linio spc ] 0 setdash } % -. n |
856
|
|
|
|
|
|
|
{ [ dah spc dah spc dah spc linio spc ] 0 setdash } % --- o |
857
|
|
|
|
|
|
|
{ [ dah spc dit spc dit spc dah spc linio spc ] 0 setdash } % -..- p |
858
|
|
|
|
|
|
|
{ [ dah spc dah spc dit spc dah spc linio spc ] 0 setdash } % --.- q |
859
|
|
|
|
|
|
|
{ [ dit spc dah spc dit spc linio spc ] 0 setdash } % .-. r |
860
|
|
|
|
|
|
|
{ [ dit spc dit spc dit spc linio spc ] 0 setdash } % ... s |
861
|
|
|
|
|
|
|
{ [ dah spc linio spc ] 0 setdash } % - t |
862
|
|
|
|
|
|
|
{ [ dah spc dit spc dit spc linio spc ] 0 setdash } % ..- u |
863
|
|
|
|
|
|
|
{ [ dit spc dit spc dit spc dah spc linio spc ] 0 setdash } % ...- v |
864
|
|
|
|
|
|
|
{ [ dah spc dah spc dit spc linio spc ] 0 setdash } % --. w |
865
|
|
|
|
|
|
|
{ [ dah spc dit spc dit spc dah spc linio spc ] 0 setdash } % -..- x |
866
|
|
|
|
|
|
|
{ [ dah spc dit spc dah spc dah spc linio spc ] 0 setdash } % -.-- y |
867
|
|
|
|
|
|
|
{ [ dah spc dah spc dit spc dit spc linio spc ] 0 setdash } % --.. z |
868
|
|
|
|
|
|
|
] def |
869
|
|
|
|
|
|
|
|
870
|
|
|
|
|
|
|
/set_color_rgb { |
871
|
|
|
|
|
|
|
3 { 16#ff div 3 1 roll } repeat |
872
|
|
|
|
|
|
|
setrgbcolor |
873
|
|
|
|
|
|
|
} def |
874
|
|
|
|
|
|
|
|
875
|
|
|
|
|
|
|
% User can add more colors by redefining this array with another |
876
|
|
|
|
|
|
|
% containing the any of the common browser web color names as per |
877
|
|
|
|
|
|
|
% the separate dictionary herewith included. |
878
|
|
|
|
|
|
|
/web_colors [ |
879
|
|
|
|
|
|
|
/Red /Lime /Blue |
880
|
|
|
|
|
|
|
/Yellow /Magenta /Cyan |
881
|
|
|
|
|
|
|
] def |
882
|
|
|
|
|
|
|
|
883
|
|
|
|
|
|
|
/show_color_id { % ( str i -- ) |
884
|
|
|
|
|
|
|
/id_size font_size 0.8 mul def |
885
|
|
|
|
|
|
|
currentrgbcolor 5 3 roll |
886
|
|
|
|
|
|
|
1 sub web_colors length mod |
887
|
|
|
|
|
|
|
web_colors exch |
888
|
|
|
|
|
|
|
get cvx exec |
889
|
|
|
|
|
|
|
set_color_rgb |
890
|
|
|
|
|
|
|
segregate? { |
891
|
|
|
|
|
|
|
dup 1 1 index length 1 sub getinterval |
892
|
|
|
|
|
|
|
( ) show dup show |
893
|
|
|
|
|
|
|
gsave |
894
|
|
|
|
|
|
|
align_center |
895
|
|
|
|
|
|
|
0 id_size -0.7 mul rmoveto |
896
|
|
|
|
|
|
|
0 1 getinterval |
897
|
|
|
|
|
|
|
/Symbol findfont id_size scalefont setfont |
898
|
|
|
|
|
|
|
dup align_center |
899
|
|
|
|
|
|
|
show |
900
|
|
|
|
|
|
|
grestore |
901
|
|
|
|
|
|
|
}{ |
902
|
|
|
|
|
|
|
show |
903
|
|
|
|
|
|
|
} ifelse |
904
|
|
|
|
|
|
|
font_size 5 div font_size 7 div rmoveto |
905
|
|
|
|
|
|
|
gsave |
906
|
|
|
|
|
|
|
/Symbol findfont id_size scalefont setfont |
907
|
|
|
|
|
|
|
(\267) show % bullet |
908
|
|
|
|
|
|
|
grestore |
909
|
|
|
|
|
|
|
font_size 2 div font_size -7 div rmoveto |
910
|
|
|
|
|
|
|
setrgbcolor |
911
|
|
|
|
|
|
|
} def |
912
|
|
|
|
|
|
|
|
913
|
|
|
|
|
|
|
/pick_dash_&_color { |
914
|
|
|
|
|
|
|
dash_procs data_set_id 1 sub |
915
|
|
|
|
|
|
|
dash_procs length mod get |
916
|
|
|
|
|
|
|
cvx exec |
917
|
|
|
|
|
|
|
|
918
|
|
|
|
|
|
|
/line_color |
919
|
|
|
|
|
|
|
web_colors |
920
|
|
|
|
|
|
|
curve_id 1 sub web_colors length mod |
921
|
|
|
|
|
|
|
get 32 string cvs |
922
|
|
|
|
|
|
|
( set_color_rgb ) splice_asn cvx |
923
|
|
|
|
|
|
|
def |
924
|
|
|
|
|
|
|
|
925
|
|
|
|
|
|
|
line_color exec |
926
|
|
|
|
|
|
|
/id_point_char curve_id 3 string cvs def |
927
|
|
|
|
|
|
|
|
928
|
|
|
|
|
|
|
data_sets 1 gt { |
929
|
|
|
|
|
|
|
/id_point_char ( ) id_point_char splice_asn def |
930
|
|
|
|
|
|
|
id_point_char 0 (A) 0 get data_set_id |
931
|
|
|
|
|
|
|
1 sub add |
932
|
|
|
|
|
|
|
put |
933
|
|
|
|
|
|
|
}if |
934
|
|
|
|
|
|
|
|
935
|
|
|
|
|
|
|
/curve_id inc_value |
936
|
|
|
|
|
|
|
} def |
937
|
|
|
|
|
|
|
|
938
|
|
|
|
|
|
|
|
939
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%% |
940
|
|
|
|
|
|
|
%% END Graphing PROLOG %% |
941
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%% |
942
|
|
|
|
|
|
|
|
943
|
|
|
|
|
|
|
EOHD |
944
|
|
|
|
|
|
|
|
945
|
|
|
|
|
|
|
|
946
|
1
|
|
|
|
|
2
|
our $ps_prolog_data_arrays = <<'EOHD'; # Perl::Critic errs about THIS pkg var! |
947
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
948
|
|
|
|
|
|
|
%% BEGIN Data Arrays PROLOG %% |
949
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
950
|
|
|
|
|
|
|
|
951
|
|
|
|
|
|
|
/data_set_id 1 def |
952
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
/append_data_set_id { |
954
|
|
|
|
|
|
|
(-) |
955
|
|
|
|
|
|
|
data_set_id 32 string cvs |
956
|
|
|
|
|
|
|
splice_asn |
957
|
|
|
|
|
|
|
splice_asn |
958
|
|
|
|
|
|
|
} def |
959
|
|
|
|
|
|
|
|
960
|
|
|
|
|
|
|
/pointer 0 def |
961
|
|
|
|
|
|
|
|
962
|
|
|
|
|
|
|
/fetch_column_arrays { |
963
|
|
|
|
|
|
|
0 { |
964
|
|
|
|
|
|
|
(column_array-) 1 index |
965
|
|
|
|
|
|
|
2 string cvs splice_asn |
966
|
|
|
|
|
|
|
append_data_set_id |
967
|
|
|
|
|
|
|
cvn |
968
|
|
|
|
|
|
|
currentdict 1 index known { |
969
|
|
|
|
|
|
|
dup cvx exec |
970
|
|
|
|
|
|
|
[] ne { |
971
|
|
|
|
|
|
|
(column_array-) |
972
|
|
|
|
|
|
|
2 index 3 string cvs splice_asn |
973
|
|
|
|
|
|
|
cvn 1 index cvx exec |
974
|
|
|
|
|
|
|
dup length array |
975
|
|
|
|
|
|
|
copy def |
976
|
|
|
|
|
|
|
pop |
977
|
|
|
|
|
|
|
}{ |
978
|
|
|
|
|
|
|
pop |
979
|
|
|
|
|
|
|
} ifelse |
980
|
|
|
|
|
|
|
}{ |
981
|
|
|
|
|
|
|
pop pop exit |
982
|
|
|
|
|
|
|
} ifelse |
983
|
|
|
|
|
|
|
1 add |
984
|
|
|
|
|
|
|
} loop |
985
|
|
|
|
|
|
|
} bind def |
986
|
|
|
|
|
|
|
|
987
|
|
|
|
|
|
|
/min_max_cnt 50 def |
988
|
|
|
|
|
|
|
|
989
|
|
|
|
|
|
|
/init_min_max_vals { |
990
|
|
|
|
|
|
|
/max_max_vals |
991
|
|
|
|
|
|
|
min_max_cnt array |
992
|
|
|
|
|
|
|
0 1 min_max_cnt 1 sub { |
993
|
|
|
|
|
|
|
1 index exch 16#80000000 put |
994
|
|
|
|
|
|
|
} for |
995
|
|
|
|
|
|
|
def |
996
|
|
|
|
|
|
|
/max_max_vals_y2 [ max_max_vals aload pop ] def |
997
|
|
|
|
|
|
|
/min_min_vals |
998
|
|
|
|
|
|
|
min_max_cnt array |
999
|
|
|
|
|
|
|
0 1 min_max_cnt 1 sub { |
1000
|
|
|
|
|
|
|
1 index exch 16#7fffffff put |
1001
|
|
|
|
|
|
|
} for |
1002
|
|
|
|
|
|
|
def |
1003
|
|
|
|
|
|
|
/min_min_vals_y2 [ min_min_vals aload pop ] def |
1004
|
|
|
|
|
|
|
} def |
1005
|
|
|
|
|
|
|
|
1006
|
|
|
|
|
|
|
init_min_max_vals |
1007
|
|
|
|
|
|
|
|
1008
|
|
|
|
|
|
|
/y2? { |
1009
|
|
|
|
|
|
|
curve_id 1 sub false |
1010
|
|
|
|
|
|
|
y2 |
1011
|
|
|
|
|
|
|
fake_col_zero_flag { dec_array_elems } if |
1012
|
|
|
|
|
|
|
{ 2 index eq or } forall |
1013
|
|
|
|
|
|
|
exch pop |
1014
|
|
|
|
|
|
|
} def |
1015
|
|
|
|
|
|
|
|
1016
|
|
|
|
|
|
|
/segregate_y_coords { |
1017
|
|
|
|
|
|
|
y2 |
1018
|
|
|
|
|
|
|
fake_col_zero_flag { dec_array_elems } if |
1019
|
|
|
|
|
|
|
{ |
1020
|
|
|
|
|
|
|
min_min_vals 1 index get |
1021
|
|
|
|
|
|
|
min_min_vals_y2 2 index get |
1022
|
|
|
|
|
|
|
min_min_vals exch |
1023
|
|
|
|
|
|
|
3 index exch put |
1024
|
|
|
|
|
|
|
min_min_vals_y2 exch |
1025
|
|
|
|
|
|
|
2 index exch put |
1026
|
|
|
|
|
|
|
max_max_vals 1 index get |
1027
|
|
|
|
|
|
|
max_max_vals_y2 2 index get |
1028
|
|
|
|
|
|
|
max_max_vals exch |
1029
|
|
|
|
|
|
|
3 index exch put |
1030
|
|
|
|
|
|
|
max_max_vals_y2 exch |
1031
|
|
|
|
|
|
|
2 index exch put |
1032
|
|
|
|
|
|
|
pop |
1033
|
|
|
|
|
|
|
} forall |
1034
|
|
|
|
|
|
|
} def |
1035
|
|
|
|
|
|
|
|
1036
|
|
|
|
|
|
|
/exch_y_coords { |
1037
|
|
|
|
|
|
|
/max_max_vals max_max_vals_y2 |
1038
|
|
|
|
|
|
|
/max_max_vals_y2 max_max_vals |
1039
|
|
|
|
|
|
|
def def |
1040
|
|
|
|
|
|
|
|
1041
|
|
|
|
|
|
|
/min_min_vals min_min_vals_y2 |
1042
|
|
|
|
|
|
|
/min_min_vals_y2 min_min_vals |
1043
|
|
|
|
|
|
|
def def |
1044
|
|
|
|
|
|
|
} def |
1045
|
|
|
|
|
|
|
|
1046
|
|
|
|
|
|
|
/all_y_cols_max { |
1047
|
|
|
|
|
|
|
16#80000000 |
1048
|
|
|
|
|
|
|
1 1 min_max_cnt 1 sub { |
1049
|
|
|
|
|
|
|
max_max_vals exch get |
1050
|
|
|
|
|
|
|
dup 2 index gt { |
1051
|
|
|
|
|
|
|
exch pop |
1052
|
|
|
|
|
|
|
}{ |
1053
|
|
|
|
|
|
|
pop |
1054
|
|
|
|
|
|
|
} ifelse |
1055
|
|
|
|
|
|
|
} for |
1056
|
|
|
|
|
|
|
} def |
1057
|
|
|
|
|
|
|
|
1058
|
|
|
|
|
|
|
/all_y_cols_min { |
1059
|
|
|
|
|
|
|
16#7fffffff |
1060
|
|
|
|
|
|
|
1 1 min_max_cnt 1 sub { |
1061
|
|
|
|
|
|
|
min_min_vals exch get |
1062
|
|
|
|
|
|
|
dup 2 index lt { |
1063
|
|
|
|
|
|
|
exch pop |
1064
|
|
|
|
|
|
|
}{ |
1065
|
|
|
|
|
|
|
pop |
1066
|
|
|
|
|
|
|
} ifelse |
1067
|
|
|
|
|
|
|
} for |
1068
|
|
|
|
|
|
|
} def |
1069
|
|
|
|
|
|
|
|
1070
|
|
|
|
|
|
|
/max_max_store { |
1071
|
|
|
|
|
|
|
max_max_vals 3 index get |
1072
|
|
|
|
|
|
|
1 index lt { |
1073
|
|
|
|
|
|
|
max_max_vals 3 index |
1074
|
|
|
|
|
|
|
2 index put |
1075
|
|
|
|
|
|
|
} if |
1076
|
|
|
|
|
|
|
} def |
1077
|
|
|
|
|
|
|
|
1078
|
|
|
|
|
|
|
/min_min_store { |
1079
|
|
|
|
|
|
|
min_min_vals 3 index get |
1080
|
|
|
|
|
|
|
1 index gt { |
1081
|
|
|
|
|
|
|
min_min_vals 3 index |
1082
|
|
|
|
|
|
|
2 index put |
1083
|
|
|
|
|
|
|
} if |
1084
|
|
|
|
|
|
|
} def |
1085
|
|
|
|
|
|
|
|
1086
|
|
|
|
|
|
|
/max_column_val { |
1087
|
|
|
|
|
|
|
16#80000000 |
1088
|
|
|
|
|
|
|
0 1 |
1089
|
|
|
|
|
|
|
column_array length 1 sub { |
1090
|
|
|
|
|
|
|
column_array exch get |
1091
|
|
|
|
|
|
|
dup 2 index gt { |
1092
|
|
|
|
|
|
|
exch pop |
1093
|
|
|
|
|
|
|
}{ |
1094
|
|
|
|
|
|
|
pop |
1095
|
|
|
|
|
|
|
} ifelse |
1096
|
|
|
|
|
|
|
} for |
1097
|
|
|
|
|
|
|
dup 0.0 eq { pop 1e-38 } if |
1098
|
|
|
|
|
|
|
} def |
1099
|
|
|
|
|
|
|
|
1100
|
|
|
|
|
|
|
/min_column_val { % ( -- real) |
1101
|
|
|
|
|
|
|
16#7fffffff |
1102
|
|
|
|
|
|
|
0 1 |
1103
|
|
|
|
|
|
|
column_array length 1 sub { |
1104
|
|
|
|
|
|
|
column_array exch get |
1105
|
|
|
|
|
|
|
dup 2 index lt { |
1106
|
|
|
|
|
|
|
exch pop |
1107
|
|
|
|
|
|
|
}{ |
1108
|
|
|
|
|
|
|
pop |
1109
|
|
|
|
|
|
|
} ifelse |
1110
|
|
|
|
|
|
|
} for |
1111
|
|
|
|
|
|
|
} def |
1112
|
|
|
|
|
|
|
|
1113
|
|
|
|
|
|
|
/max_all_columns { |
1114
|
|
|
|
|
|
|
0 { |
1115
|
|
|
|
|
|
|
(column_array-) |
1116
|
|
|
|
|
|
|
1 index 32 string cvs splice_asn dup cvn |
1117
|
|
|
|
|
|
|
(columnMax-) 3 index 32 string cvs |
1118
|
|
|
|
|
|
|
splice_asn cvn |
1119
|
|
|
|
|
|
|
|
1120
|
|
|
|
|
|
|
currentdict 2 index known { |
1121
|
|
|
|
|
|
|
1 index cvx exec length |
1122
|
|
|
|
|
|
|
0 eq { pop pop pop exit} if |
1123
|
|
|
|
|
|
|
}{ |
1124
|
|
|
|
|
|
|
pop pop pop exit |
1125
|
|
|
|
|
|
|
} ifelse |
1126
|
|
|
|
|
|
|
|
1127
|
|
|
|
|
|
|
3 -1 roll pop |
1128
|
|
|
|
|
|
|
|
1129
|
|
|
|
|
|
|
/column_array 3 -1 roll cvx exec def |
1130
|
|
|
|
|
|
|
|
1131
|
|
|
|
|
|
|
max_column_val max_max_store def |
1132
|
|
|
|
|
|
|
|
1133
|
|
|
|
|
|
|
dup 32 string cvs (columnMin-) exch splice_asn cvn |
1134
|
|
|
|
|
|
|
min_column_val |
1135
|
|
|
|
|
|
|
min_min_store |
1136
|
|
|
|
|
|
|
def |
1137
|
|
|
|
|
|
|
|
1138
|
|
|
|
|
|
|
not_shown length { |
1139
|
|
|
|
|
|
|
2 add |
1140
|
|
|
|
|
|
|
show_this_curve? { 2 sub exit } if |
1141
|
|
|
|
|
|
|
1 sub |
1142
|
|
|
|
|
|
|
} repeat |
1143
|
|
|
|
|
|
|
|
1144
|
|
|
|
|
|
|
1 add |
1145
|
|
|
|
|
|
|
} loop |
1146
|
|
|
|
|
|
|
pop |
1147
|
|
|
|
|
|
|
} def |
1148
|
|
|
|
|
|
|
|
1149
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1150
|
|
|
|
|
|
|
%% END Data Arrays PROLOG %% |
1151
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1152
|
|
|
|
|
|
|
|
1153
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1154
|
|
|
|
|
|
|
%% BEGIN User Overwritable DEFAULTS %% |
1155
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1156
|
|
|
|
|
|
|
|
1157
|
|
|
|
|
|
|
% Of chans provided, which not to show. Their colors will be skipped. |
1158
|
|
|
|
|
|
|
/not_shown [] def |
1159
|
|
|
|
|
|
|
|
1160
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1161
|
|
|
|
|
|
|
%% END User Overwritable DEFAULTS %% |
1162
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1163
|
|
|
|
|
|
|
|
1164
|
|
|
|
|
|
|
EOHD |
1165
|
|
|
|
|
|
|
|
1166
|
|
|
|
|
|
|
|
1167
|
1
|
|
|
|
|
2
|
our $ps_prolog_drawing = <<'EOHD'; # Perl::Critic errs about THIS pkg var! |
1168
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%% |
1169
|
|
|
|
|
|
|
%% BEGIN drawing PROLOG %% |
1170
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%% |
1171
|
|
|
|
|
|
|
|
1172
|
|
|
|
|
|
|
% RETURN false IF A CHANNEL IS AMONG THOSE EXCLUDED FROM DISPLAY BY USER. |
1173
|
|
|
|
|
|
|
/show_this_curve? { |
1174
|
|
|
|
|
|
|
true |
1175
|
|
|
|
|
|
|
not_shown { |
1176
|
|
|
|
|
|
|
1 add |
1177
|
|
|
|
|
|
|
2 index ne |
1178
|
|
|
|
|
|
|
and |
1179
|
|
|
|
|
|
|
} forall |
1180
|
|
|
|
|
|
|
} def |
1181
|
|
|
|
|
|
|
|
1182
|
|
|
|
|
|
|
% DRAW CURVES FOR ALL CHANNELS NOT EXCLUDED BY USER. |
1183
|
|
|
|
|
|
|
/draw_all_curves { |
1184
|
|
|
|
|
|
|
/curve_id 1 def |
1185
|
|
|
|
|
|
|
init_graph_params |
1186
|
|
|
|
|
|
|
do_graph |
1187
|
|
|
|
|
|
|
thicker |
1188
|
|
|
|
|
|
|
clear |
1189
|
|
|
|
|
|
|
|
1190
|
|
|
|
|
|
|
/data_sets data_set_id def |
1191
|
|
|
|
|
|
|
|
1192
|
|
|
|
|
|
|
1 1 data_set_id { |
1193
|
|
|
|
|
|
|
/curve_id 1 def |
1194
|
|
|
|
|
|
|
/data_set_id 1 index def |
1195
|
|
|
|
|
|
|
fetch_column_arrays |
1196
|
|
|
|
|
|
|
(columns_cnt-) splice_as_name cvx exec |
1197
|
|
|
|
|
|
|
1 sub { draw_one_curve } repeat |
1198
|
|
|
|
|
|
|
pop |
1199
|
|
|
|
|
|
|
} for |
1200
|
|
|
|
|
|
|
} def |
1201
|
|
|
|
|
|
|
|
1202
|
|
|
|
|
|
|
/external_control_config { |
1203
|
|
|
|
|
|
|
1 { |
1204
|
|
|
|
|
|
|
(column_array-) splice_as_name currentdict exch |
1205
|
|
|
|
|
|
|
known not { |
1206
|
|
|
|
|
|
|
/columns_cnt-1 exch def |
1207
|
|
|
|
|
|
|
exit |
1208
|
|
|
|
|
|
|
} if |
1209
|
|
|
|
|
|
|
1 add |
1210
|
|
|
|
|
|
|
} loop |
1211
|
|
|
|
|
|
|
|
1212
|
|
|
|
|
|
|
/rows_cnt-1 column_array-1 length def |
1213
|
|
|
|
|
|
|
|
1214
|
|
|
|
|
|
|
fake_col_zero_flag { |
1215
|
|
|
|
|
|
|
/column_array-0 [ |
1216
|
|
|
|
|
|
|
0 |
1217
|
|
|
|
|
|
|
column_array-1 length { |
1218
|
|
|
|
|
|
|
dup |
1219
|
|
|
|
|
|
|
1 fake_col_zero_scale mul add |
1220
|
|
|
|
|
|
|
} repeat |
1221
|
|
|
|
|
|
|
] def |
1222
|
|
|
|
|
|
|
/y2 y2 inc_array_elems def |
1223
|
|
|
|
|
|
|
} if |
1224
|
|
|
|
|
|
|
|
1225
|
|
|
|
|
|
|
/segregate? |
1226
|
|
|
|
|
|
|
y2 length 0 eq { |
1227
|
|
|
|
|
|
|
false |
1228
|
|
|
|
|
|
|
}{ |
1229
|
|
|
|
|
|
|
true |
1230
|
|
|
|
|
|
|
} ifelse |
1231
|
|
|
|
|
|
|
def |
1232
|
|
|
|
|
|
|
|
1233
|
|
|
|
|
|
|
max_all_columns |
1234
|
|
|
|
|
|
|
} def |
1235
|
|
|
|
|
|
|
|
1236
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%% |
1237
|
|
|
|
|
|
|
%% END drawing PROLOG %% |
1238
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%% |
1239
|
|
|
|
|
|
|
|
1240
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1241
|
|
|
|
|
|
|
%% BEGIN User-Editable DEFAULTS %% |
1242
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1243
|
|
|
|
|
|
|
|
1244
|
|
|
|
|
|
|
% Here are things the user can change by putting in different |
1245
|
|
|
|
|
|
|
% settings, preferably via the Perl interface, rather than here, |
1246
|
|
|
|
|
|
|
% although either way will work. |
1247
|
|
|
|
|
|
|
|
1248
|
|
|
|
|
|
|
/data_sets 1 def % When used standalone (not with Perl). |
1249
|
|
|
|
|
|
|
|
1250
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1251
|
|
|
|
|
|
|
%% END User-Editable DEFAULTS %% |
1252
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1253
|
|
|
|
|
|
|
|
1254
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1255
|
|
|
|
|
|
|
%% BEGIN Perl-inserted CODE %% |
1256
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1257
|
|
|
|
|
|
|
|
1258
|
|
|
|
|
|
|
EOHD |
1259
|
|
|
|
|
|
|
|
1260
|
|
|
|
|
|
|
|
1261
|
1
|
|
|
|
|
29
|
our $ps_tail = <<'EOHD'; # Perl::Critic errs about THIS pkg var! |
1262
|
|
|
|
|
|
|
|
1263
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1264
|
|
|
|
|
|
|
%% END Perl-inserted CODE %% |
1265
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
1266
|
|
|
|
|
|
|
|
1267
|
|
|
|
|
|
|
external_control_config |
1268
|
|
|
|
|
|
|
bg_color_bbox |
1269
|
|
|
|
|
|
|
draw_all_curves |
1270
|
|
|
|
|
|
|
end % Lose the OminGraphDict |
1271
|
|
|
|
|
|
|
end % Lose the web_colorsDict |
1272
|
|
|
|
|
|
|
clear |
1273
|
|
|
|
|
|
|
grestore |
1274
|
|
|
|
|
|
|
showpage |
1275
|
|
|
|
|
|
|
|
1276
|
|
|
|
|
|
|
EOHD |
1277
|
|
|
|
|
|
|
|
1278
|
|
|
|
|
|
|
} # BEGIN |
1279
|
|
|
|
|
|
|
|
1280
|
|
|
|
|
|
|
1; |
1281
|
|
|
|
|
|
|
|
1282
|
|
|
|
|
|
|
__END__ |