Debian Codegraph @

hugo/static/img/draw/decay2lattice.eps

raw
1 %!PS-Adobe-1.0 EPSF-1.0
2 %%BoundingBox: 29 464 467 703
3 %%Comment: Bounding box extracted by bboxx
4 %%+: A program by Dov Grobgeld 2003
5 %%Comment: Bounding box extracted by bboxx
6 %%+: A program by Dov Grobgeld 2003
7
8 % Because we we use clipping to suppress excess lattice points, the bounding box
9 % is not correctly transmitted to SVG by our standard ttols ps2pdf | pdf2svg.
10 % Therefore, copy the following to the SVG file:
11 % <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="25 75 400 250">
12
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14 %% FRIDA: fast reliable interactive data analysis %%
15 %% wups24a.ps: graphic macros %%
16 %% (C) Joachim Wuttke 1990-2024 %%
17 %% http://www.messen-und-deuten.de/frida %%
18 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19
20 /WuGdict24a 400 dict def
21 WuGdict24a begin
22
23 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
24 %% Generic and math operators
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26
27 %% Shortcuts:
28
29 /np { newpath } bind def
30 /mv { moveto } bind def
31 /rm { rmoveto } bind def
32 /rl { rlineto } bind def
33 /li { lineto } bind def
34 /cp { closepath } bind def
35 /st { stroke } bind def
36 /x { exch } bind def
37 /gs { gsave } bind def
38 /gr { grestore } bind def
39 /G { gsave exec grestore } bind def
40
41 %% Math operators:
42
43 /twopi { 6.2831853072 } def
44
45 /rnd { rand cvr 1 30 bitshift div 2 div 0 max 1 min } def % -> between 0 and 1
46
47 /min { 2 copy gt { x } if pop } def
48 /max { 2 copy lt { x } if pop } def
49
50 /tan { dup sin x cos div } def
51 /cot { dup cos x sin div } def
52 /pol2xy{ 2 copy cos mul 3 1 roll sin mul } def % r phi | x y
53
54 /eexp { 2.71828 x exp } def % "exp" is x^y, eexp is e^x
55 /tanh { 2.71828 x 2 copy exp 3 1 roll neg exp 2 copy sub 3 1 roll add div } def
56
57 %% Loop:
58
59 /iterate { % xi yi what dx dy num_repeats | - %% after each repeat, translates by (dx,dy)
60 gsave
61 6 4 roll xym translate % what x_mv y_mv num_repeats
62 { % what x_mv y_mv
63 3 copy
64 3 2 roll
65 exec
66 xym translate
67 } repeat
68 pop pop pop
69 grestore
70 } def
71
72 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73 %% Incremental path construction with persistent direction
74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75
76 /NP { % x y [new path]
77 gsave translate np 0 0 mv } bind def
78 /EP { % [end path]
79 grestore } bind def
80 /L { % len rel_dir [line]
81 90 mul rotate 0 2 copy rl translate } bind def
82 /A { % radius angle [arc segment]
83 /IPCa x 90 mul def /IPCr x def
84 IPCa 0 lt
85 {
86 0 IPCr neg IPCr 90 90 IPCa add arcn
87 0 IPCr neg translate IPCa rotate 0 IPCr translate
88 } {
89 0 IPCr IPCr -90 -90 IPCa add arc
90 0 IPCr translate IPCa rotate 0 IPCr neg translate
91 } ifelse
92 } def
93 /V { % size [simple arrow] -
94 gsave /IPCr x def np -.8 IPCr mul .6 IPCr mul mv
95 0 0 li -.8 IPCr mul -.6 IPCr mul li st grestore
96 } def % size [arrow]
97 /Vc { % size [triangular unfilled arrow] -
98 gsave /IPCr x def np -.8 IPCr mul .6 IPCr mul mv
99 0 0 li -.8 IPCr mul -.6 IPCr mul li cp { white fill } G st grestore
100 } def %
101
102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
103 %% Page coordinates
104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
105
106 /pt { .018567 mul} bind def % for line widths and font sizes, reason unclear
107 /cm {28.346456 mul} bind def % typographic_point -> cm
108
109 /cmtranslate { % x y [] -
110 cm x cm x translate } bind def
111
112 % Move origin from lower left (PostScript default) to upper left
113 /setnewpage { % xoff yoff
114 /yoffnewpage x def
115 /xoffnewpage x def
116 } def
117 /originUpperLeft_A4{ .7 28.3 cmtranslate } bind def
118 /goffsetA4 { ungscale originUpperLeft_A4 gscale } def
119 /newpage {
120 goffsetA4
121 xoffnewpage yoffnewpage offset
122 } def
123
124 % Set absolute global scale and relative symbol size
125 /defsiz { % size(cm) symbolsize(rel) | -
126 /ftot x def
127 /gsiz x cm 10 div def
128 gscale % within 'size', coordinates run from 0 to 10
129 } def
130 /gscale {
131 gsiz dup scale
132 } def
133 /ungscale {
134 1 gsiz div dup scale
135 } def
136
137 % Symbol (and label?) size as sublinear function of figure size
138 /autolabel { % size(cm) | symbolsize(rel)
139 dup 7 div 2 add 4 mul % the simplest sublinear increase
140 x div % anticipate overall rescaling
141 } def
142
143 % Aspect ratios
144 /gyld {0.447214 mul} bind def /Gyld {0.447214 div} bind def % sqrt(5)
145 /guld {0.547723 mul} bind def /Guld {0.547723 div} bind def % sqrt(3)
146 /gold {0.618034 mul} bind def /Gold {0.618034 div} bind def % goldener Schnitt
147 /gild {0.707107 mul} bind def /Gild {0.707107 div} bind def % sqrt(2) : DIN
148 /geld {0.759836 mul} bind def /Geld {0.759836 div} bind def % sqrt(sqrt(3))
149 /gald {0.817765 mul} bind def /Gald {0.817765 div} bind def % sqrt sqrt sqrt 5
150
151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
152 %% Several frames per page
153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154
155 /setpagegrid { % ncol nrow xoffnewframe yoffnewframe
156 /yoffnewframe x def
157 /xoffnewframe x def
158 /nrowpage x def
159 /ncolpage x def
160 } def
161 /iFrame 0 def
162 /nextFrame {
163 /iFrame iFrame 1 add def
164 iFrame nrowpage ncolpage mul mod 0 eq {
165 showpage gscale newpage
166 } {
167 iFrame ncolpage mod 0 eq {
168 xoffnewframe ncolpage 1 sub neg mul yoffnewframe offset
169 } {
170 xoffnewframe 0 offset
171 } ifelse
172 } ifelse
173 } def
174
175 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
176 %% Frame coordinates
177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
178
179 /defred { % x_reduction y_reduction label_reduction | -
180 /fmm x ftot mul def
181 /ymm x def
182 /xmm x def
183
184 % conversion frame_coordinate -> global_coord
185 /xm {xmm mul} bind def
186 /ym {ymm mul} bind def
187 /fm {fmm mul} bind def
188 /xym {ym x xm x} bind def
189
190 % prefer rescaling over explicit conversion (make more use of this !)
191 /mmscale { xmm ymm scale } bind def
192 /mmunscale { 1 xmm div 1 ymm div scale } bind def
193
194 % graphic commands in frame coordinates
195 /offset { xym translate } bind def
196 /currentxy { currentpoint ymm div x xmm div x } bind def
197 /setline { pt fm setlinewidth [] 0 setdash } bind def
198 } def
199
200 /stdred { % x_reduction y_reduction | -
201 2 copy mul sqrt defred
202 } def
203
204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
205 %% World (= user application) coordinates
206 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
207
208 /xSetCoord { % log min max | -
209 /wxmax x def
210 /wxmin x def
211 /wxlog x 0 eq not def
212 /wxdel wxmax wxmin wxlog { div log } { sub } ifelse def
213 /wxd { % dx(world) | dx(frame)
214 wxlog { log } if wxdel div 10 mul
215 } bind def
216 /wx { % x(world) | x(frame)
217 wxmin wxlog { div } { sub } ifelse
218 wxd
219 } bind def
220 } def
221 /ySetCoord { % log min max | -
222 /wymax x def
223 /wymin x def
224 /wylog x 0 eq not def
225 /wydel wymax wymin wylog { div log } { sub } ifelse def
226 /wyd { % dy(world) | dy(frame)
227 wylog { log } if wydel div 10 mul
228 } bind def
229 /wy { % y(world) | y(frame)
230 wymin wylog { div } { sub } ifelse
231 wyd
232 } bind def
233 } def
234 /hSetCoord { % log min max | - % for use in 2D plot
235 /whmax x def
236 /whmin x def
237 /whlog x 0 eq not def
238 /wH { % h(world) | h(col)
239 dup whmin lt {
240 pop -1
241 } {
242 dup whmax gt {
243 pop 11
244 } {
245 wh
246 } ifelse
247 } ifelse
248 } bind def
249 whlog {
250 /whdel whmax whmin div log def
251 /wh { whmin div log whdel div 10 mul } bind def % h(world) | h(col)
252 } {
253 /whdel whmax whmin sub def
254 /wh { whmin sub whdel div 10 mul } bind def % h(world) | h(col)
255 } ifelse
256 } def
257
258 % pair conversion
259 /wxy { % x,y(world) -> x,y(frame)
260 wy x wx x
261 } def
262
263
264 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
265 %% Colors %%
266 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
267
268 %% Color operators:
269
270 /setRGBcolor {
271 3 { 255 div 3 1 roll } repeat setrgbcolor
272 } def
273
274 /colormix { % weight(0..1) col1(R|G|B) col2(R|G|B) | col(R|G|B)
275 7 -1 roll dup /weightA x def /weightB x 1 x sub def
276 4 -1 roll weightA mul x weightB mul add 5 1 roll
277 3 -1 roll weightA mul x weightB mul add 4 1 roll
278 2 -1 roll weightA mul x weightB mul add 3 1 roll
279 } def
280
281 /relcol { % i_col n_col | rel(0..1) : for one-dimensional choices
282 1 sub div 0 max 1 min
283 } def
284
285 %% Named colors:
286
287 /black { 0 setgray } bind def
288 /white { 1 setgray } bind def
289
290 /red { 255 0 0 setRGBcolor } bind def
291
292 /siemensorange { 255 153 0 setRGBcolor } bind def
293 /siemensblue { 0 102 153 setRGBcolor } bind def
294 /siemenstext { 0 51 102 setRGBcolor } bind def
295 /siemensred { 165 0 33 setRGBcolor } bind def
296 /siemenspink { 221 102 102 setRGBcolor } bind def
297 /siemensgrey { 221 221 221 setRGBcolor } bind def
298 /siemensdark { 102 102 102 setRGBcolor } bind def
299 /siemensgreen { 33 153 102 setRGBcolor } bind def
300 /siemensyellow { 255 221 0 setRGBcolor } bind def
301
302
303 %% One-dimensional linear color choices:
304
305 /iCol1 { % i i_max | - : default -2010, round the circle, RGBR
306 relcol dup 1 x % rel 1 rel
307 360 mul 255 add cos 1 add dup mul neg .053 mul 1 add % modulate saturation
308 sethsbcolor
309 } def
310 /iCol2 { % i i_max | - : cyan - yellow - magenta
311 relcol 3 mul
312 dup 1 le {
313 dup 1 sub neg 0 3 2 roll } {
314 dup 2 le {
315 1 sub dup 1 sub neg 0 3 1 roll } {
316 2 sub dup 1 sub neg 0 3 0 roll } ifelse
317 } ifelse
318 0 setcmykcolor
319 } def
320 /iCol3 { % i i_max | - : siemens
321 div /icnow x def
322 165 1 icnow sub mul
323 102 icnow mul
324 33 120 icnow mul add setRGBcolor
325 } def
326 /iCol4 { % i i_max | - : red to blue (subsequence of old scheme iCol1)
327 relcol
328 3 x sub 3 div 1 iCol1
329 } def
330
331
332 %% One-dimensional color choice from given array:
333
334 /iColA { % i i_max arr | -
335 /aCol x def
336 relcol
337 aCol length 1 sub mul % position within array
338 dup cvi dup 3 1 roll % idx pos idx
339 sub x % offset idx
340 0 max aCol length 1 sub min % offset safe_idx
341 dup 1 add aCol length 1 sub min % offset i i+1
342 aCol x get exec
343 4 3 roll aCol x get exec colormix setRGBcolor
344 } def
345
346 %% ditto with discontinuous values for h<0 and h>1
347
348 /iColAA { % i i_max arr {low_col} {hig_col} | -
349 5 3 roll
350 div
351 dup 0 lt {
352 pop pop x pop exec
353 } {
354 dup 1 gt {
355 pop 3 1 roll pop pop exec
356 } {
357 1 % arr {l} {h} i i_max
358 5 2 roll pop pop
359 x 1 add x % ad-hoc correction for legacy definition of relcol
360 iColA
361 } ifelse
362 } ifelse
363 } def
364
365 %% Color arrays for non-linear one-dimensional choices:
366
367 /aCol1 [ % red-blue
368 { 255 0 0 } % 1
369 { 240 10 10 } % 2
370 { 220 40 40 } % 3
371 { 205 65 90 } % 4
372 { 195 80 130 } % 5
373 { 180 110 180 } % 6
374 { 165 120 185 } % 7
375 { 150 130 190 } % 8
376 { 130 150 210 } % 9
377 { 110 125 220 } % 10
378 { 85 105 230 } % 11
379 { 70 90 255 } % 12
380 { 0 0 255 } % 13
381 ] def
382 /aCol2 [ % orange-red-blue-darkblue
383 { 255 180 0 }
384 { 255 160 0 }
385 { 255 120 0 }
386 { 255 70 0 }
387 { 255 0 0 }
388 { 220 30 30 }
389 { 220 70 60 }
390 { 220 100 110 }
391 { 200 130 130 }
392 { 200 130 160 }
393 { 180 110 180 }
394 { 165 110 185 }
395 { 150 130 190 }
396 { 130 150 210 }
397 { 100 120 220 }
398 { 85 105 230 }
399 { 70 90 255 }
400 { 0 0 255 }
401 { 0 0 180 }
402 { 10 10 150 }
403 { 30 30 130 }
404 ] def
405 /aCol3 [ % [fixed size: max_i=8] siemenscolors
406 { 165 0 33 } % siemensred
407 { 33 153 102 } % siemensgreen
408 { 0 102 153 } % siemensblue
409 { 0 51 102 } % siemenstext
410 { 255 153 0 } % siemensorange
411 { 102 102 102 } % siemensdark
412 { 255 221 0 } % siemensyellow
413 { 221 221 221 } % siemensgrey
414 { 221 102 102 } % siemenspink
415 ] def
416 /aCol4 [ % green-blue-brown
417 { 120 160 60 }
418 { 90 185 40 }
419 { 50 215 20 }
420 { 0 245 0 }
421 { 10 235 112 }
422 { 20 235 143 }
423 { 30 230 173 }
424 { 40 225 194 }
425 { 50 205 215 }
426 { 40 153 204 }
427 { 40 102 153 }
428 { 40 82 122 }
429 { 90 74 101 }
430 { 140 68 80 }
431 { 170 59 60 }
432 { 190 50 40 }
433 { 180 65 40 }
434 { 160 80 40 }
435 { 140 100 40 }
436 { 120 80 30 }
437 { 100 60 20 }
438 ] def
439 /aCol5 [ % [fixed size: max_i=7] old gnuplot default (see man gnuplot and rgb.txt)
440 { 255 0 0 } % red
441 { 0 255 0 } % green
442 { 0 0 255 } % blue
443 { 255 0 255 } % magenta
444 { 0 255 255 } % cyan
445 { 160 82 45 } % sienna
446 { 255 165 0 } % orange
447 { 255 127 80 } % coral
448 ] def
449 /aCol6 [ % heat plot
450 { 100 0 100 } % violet
451 { 60 30 130 } % dark blue
452 { 30 50 220 } % blue
453 { 50 150 100 } % green
454 { 150 200 100 } % green
455 { 215 255 50 } % green/yellow
456 { 255 255 0 } % yellow
457 { 255 125 0 } % orange
458 { 255 0 0 } % red
459 ] def
460 /aCol7 [ % [fixed size: max_i=8] default colors, modified from old gnuplot
461 { 80 80 255 } % blue
462 { 255 0 0 } % red
463 { 0 160 0 } % dark green
464 { 255 0 255 } % magenta
465 { 0 160 192 } % dark cyan
466 { 160 82 45 } % sienna
467 { 255 165 0 } % orange
468 { 255 127 80 } % coral
469 { 64 224 32 } % light greenish
470 ] def
471 /aCol8 [ % matplotlib's viridis: blue - green -yellow
472 { 64 0 79 }
473 { 72 36 117 }
474 { 65 68 135 }
475 { 53 95 141 }
476 { 42 120 142 }
477 { 33 145 140 }
478 { 34 168 132 }
479 { 68 191 112 }
480 { 122 209 81 }
481 { 189 223 38 }
482 { 239 218 34 }
483 ] def
484 /aCol9 [ % matplotlib's inferno: black - violet - red - orange - yellow
485 { 0 0 0 }
486 { 27 12 65 }
487 { 74 12 107 }
488 { 120 28 109 }
489 { 165 44 96 }
490 { 207 68 70 }
491 { 237 105 37 }
492 { 251 155 6 }
493 { 247 209 61 }
494 { 252 255 164 }
495 ] def
496
497 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
498 %% Fonts
499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
500
501 % extend font encoding
502 /ReEncode { % OldFont NewFont Encoding | -
503 /MyEncoding x def
504 x findfont % select OldFont
505 dup length dict begin
506 {def} forall
507 /Encoding MyEncoding def
508 currentdict
509 end
510 definefont pop % define as NewFont
511 } def
512
513 % we assume that image scripts are Latin1 encoded
514 /Helvetica /MyFont ISOLatin1Encoding ReEncode
515 /Helvetica-Oblique /MyFont-Oblique ISOLatin1Encoding ReEncode
516 /Helvetica-Bold /MyFont-Bold ISOLatin1Encoding ReEncode
517 /Helvetica-BoldOblique /MyFont-BoldOblique ISOLatin1Encoding ReEncode
518
519 /setPalatino {
520 /Palatino /MyFont ISOLatin1Encoding ReEncode
521 /Palatino-Italic /MyFont-Oblique ISOLatin1Encoding ReEncode
522 /Palatino-Bold /MyFont-Bold ISOLatin1Encoding ReEncode
523 /Palatino-BoldItalic /MyFont-BoldOblique ISOLatin1Encoding ReEncode
524 } def
525
526 %% Preset standard styles:
527
528 % scale and set font; define fontsize, fontheight
529 /setfontandsize { % font size | -
530 dup 0 le { pop 100 } if % fontsize <= 0 not allowed !
531 /fontnonnil true def
532 pt fm dup /fontsize x def
533 x findfont
534 x scalefont
535 setfont
536 gsave % determine fontheight - from the cookbook :
537 np 0 0 mv (W) true charpath flattenpath
538 pathbbox % low_left_x, low_left_y, up_right_x, up_right_y
539 /fontheight x def
540 /fontwidth x def
541 pop pop
542 grestore
543 } def
544
545 % standard settings for labelling axes
546 /numlabcol { black } def
547 /setnum { /MyFont 24 setfontandsize numlabcol } def
548 /setlab { /MyFont 24 setfontandsize numlabcol } def
549
550 % user commands (free choice of fontsize, but fixed font family)
551 /setown { /MyFont x setfontandsize } def
552 /setbol { /MyFont-Bold x setfontandsize } def
553 /setboq { /MyFont-BoldOblique x setfontandsize } def
554 /setobl { /MyFont-Oblique x setfontandsize } def
555
556 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
557 %% Text blocks
558 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
559
560 /showif { % string | - : increment xwidth or plot string
561 prepare
562 { stringwidth pop xwidth add /xwidth x def }
563 { show }
564 ifelse
565 } def
566 /script { % matrix relpos_y | -
567 /yoffset x fontheight mul def
568 currentfont x makefont setfont
569 0 yoffset rm
570 } def
571 /scred .71 def
572 /subsc {
573 showif
574 [scred 0 0 scred 0 0] -.2 script
575 } def
576 /supsc {
577 showif
578 [scred 0 0 scred 0 0] .6 script
579 } def
580 /endsc {
581 showif
582 regularfont setfont
583 0 yoffset neg rm
584 } def
585 /grec {
586 showif
587 /Symbol findfont fontsize scalefont setfont
588 } def
589 /endgr {
590 showif
591 regularfont setfont
592 } def
593 /endall {
594 showif
595 regularfont setfont
596 } def
597 /build { % string xrel yrel obj | - : plot obj above/below string
598 /obj x def /yrelbui x def /xrelbui x def
599 dup showif
600 prepare
601 { pop }
602 { stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
603 currentpoint 4 2 roll % save position after string
604 rm obj pop % obj must end with () that will be pop'ed
605 mv % back to saved position
606 }
607 ifelse
608 } def
609 /gbuild { % string xrel yrel obj | - : plot obj above/below string
610 /obj x def /yrelbui x def /xrelbui x def
611 /Symbol findfont fontsize scalefont setfont
612 dup showif
613 prepare
614 { pop regularfont setfont }
615 { stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
616 currentpoint 4 2 roll % save position after string
617 regularfont setfont
618 rm obj pop % obj must end with () that will be pop'ed
619 mv % back to saved position
620 }
621 ifelse
622 } def
623 /hut { % ..) (<Char>) hut (.. %%% MISERABEL PROGRAMMIERT
624 x showif
625 1.4 .6 {(\136) show ()} build
626 } def
627 /ghut { % ..) (<grec-Char>) ghut (.. %%% BREITE PASST NUR FUER Phi(t)
628 x showif
629 .8 .65 {(\136) show ()} gbuild
630 } def
631 /tilde {
632 x showif
633 1. .6 {(~) show ()} build
634 } def
635 /gtilde {
636 x showif
637 1. .6 {(~) show ()} gbuild
638 } def
639 /spce { % string n spce - ; insert n times ( )
640 {showif ( )} repeat
641 } def
642
643 % the following macros use the symbol/curve plotting mechanism
644 /pins { % string symins - ; symbol must be selected by pset
645 showif
646 ( ) showif ( ) .5 .5 { currentxy 0 p black ()} build ( ) showif
647 } def
648 /clenins { % string len clenins - ; curve must be selected by cset
649 x showif % I suppose that pins is preceeded by 8 spaces
650 dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def
651 % length of inserted curve :
652 % -1 space : curve begins and ends in middle of ( )
653 % +3 spaces: pins requires 3 times ( )
654 ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
655 2 add {( ) showif} repeat
656 } def
657 /cins { % string symins - ; curve must be selected by cset
658 showif 8 % I suppose that pins is preceeded by 8 spaces
659 dup ( ) stringwidth pop mul 2 add /xstrich x xmm div 10 div def
660 % nov03, ohne zu verstehen, "10 div" eingefuegt
661 % length of inserted curve :
662 % -1 space : curve begins and ends in middle of ( )
663 % +3 spaces: pins requires 3 times ( )
664 ( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
665 2 add {( ) showif} repeat
666 } def
667
668 /block { % x y ob xrel yrel | -
669 /yrel x def /xrel x def /blabla x def
670 /ypos x ym def /xpos x xm def
671 /regularfont currentfont def /yoffset 0 def % initialize for security
672 /prepare true def /xwidth 0 def 0 0 mv % to prevent empty-path-error
673 blabla endall % first pass : determine xwidth
674 boxif { /boxwidth xwidth (M) stringwidth pop boxxr mul 2 mul add def
675 /boxheight fontheight 1 boxyr 2 mul add mul def
676 np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub
677 ypos fontheight .5 boxyr add mul sub mv
678 boxwidth 0 rl 0 boxheight rl boxwidth neg 0 rl cp
679 boxproc
680 } if
681 xpos xwidth xrel mul sub ypos fontheight yrel mul sub mv
682 /prepare false def
683 blabla endall % second pass : plot
684 /boxif false def
685 } def
686 /rblock { % x y ang ob proc rblock -
687 5 3 roll
688 gsave
689 xym translate
690 3 2 roll rotate
691 0 0 4 2 roll exec
692 grestore
693 } def
694
695 /Box { % x y {exe}
696 /boxif true def
697 /boxproc x def /boxyr x def /boxxr x def
698 } def
699 /nBox { .6 .6 3 2 roll Box } def
700 /boxif false def
701 /textW { % obj | length : calculate only length.
702 /blabla x def
703 /regularfont currentfont def /yoffset 0 def % initialize for security
704 /prepare true def /xwidth 0 def 0 0 mv % to prevent empty-path-error
705 blabla endall
706 xwidth % has been determined
707 } def
708 /textw { % obj | y : dito, in 0..10-units
709 textW xmm div
710 } def
711
712 % horizontal text: x y ob | -
713 /textLB { 0. 0. block } bind def
714 /textCB { .5 0. block } bind def
715 /textRB { 1. 0. block } bind def
716 /textLM { 0. .5 block } bind def
717 /textCM { .5 .5 block } bind def
718 /textRM { 1. .5 block } bind def
719 /textLT { 0. 1. block } bind def
720 /textCT { .5 1. block } bind def
721 /textRT { 1. 1. block } bind def
722
723 % rotated text: x y ang ob | -
724 /rtextLB { {textLB} rblock } bind def
725 /rtextLM { {textLM} rblock } bind def
726 /rtextRB { {textRB} rblock } bind def
727 /rtextRM { {textRM} rblock } bind def
728 /rtextCM { {textCM} rblock } bind def
729
730 %% Language selection:
731
732 % preset
733 /language { % choose_this of_so_many | - % select current language
734 /langMax x def
735 /langChc x def
736 } def
737 1 1 language % default
738 % choose text from sequence
739 /langSel { % text_1 .. text_M | text_C : choose text, M=langMax, C=langChc
740 langMax dup langChc sub 1 add roll
741 langMax 1 sub { pop } repeat
742 } def
743
744 %% Text composition shortcuts:
745
746 /g { x grec endgr} bind def
747 /sb { x subsc endsc} bind def
748 /sp { x supsc endsc} bind def
749 /sbgr { x grec () subsc endsc () endgr} bind def
750 /spgr { x grec () supsc endsc () endgr} bind def
751
752 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
753 %% Coordinate Frame %%
754 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
755
756 %% Layout presets:
757
758 /xyTicLen {0.10 fm} def
759 /xyTacLen {0.20 fm} def
760 /txllen {0.20 fm} def
761 /tyllen {0.20 fm} def
762 /linsetAxx {black 0.7 setline} def
763 /linsetTic {black 0.7 setline} def
764 /linsetTac {black 0.7 setline} def
765 /linsetGri {black 0.4 setline} def
766
767 %% Start-up commands:
768
769 /Resets {
770 /yNumLengthL 0 def /yNumLengthH 0 def
771 /xNumHeightL .3 def /xNumHeightH 0 def
772 /xNumHeightRel 2.4 def
773 /aMean 5 def
774 black
775 } def
776 /BoxBackground {
777 0 10 0 10 rect gsave setboxbackgroundcolor fill grestore
778 } def
779 /setboxbackgroundcolor { white } def
780
781 /zValues { pop pop } def
782 /whiteframe { 1 0 0 10 10 graybox } def
783
784 /abc {abclab setown abcx abcy 3 2 roll textCM} def % usage ((a)) abc
785 /abcset { % x y siz abcset - : preset for abc
786 /abclab x def /abcy x def /abcx x def
787 } def
788
789 %% Ticks:
790
791 % set tick array - internal macros
792 /tiputs { % rel_pos_of_tick | pos_of_tick : innermost routine for /taproc
793 tastep mul taloop add
794 } def
795 /taproclin { % (#tick/tack) | - : define /taproc for use in SetVec
796 1 x div /tistep x def
797 /taproc { 0 tistep .999 { tiputs } for } def
798 } def
799 /taproclog { % (#ticks/tacks) | - : define /taproc for use in SetVec
800 dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def
801 }{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def
802 }{ dup 0 gt { pop /taproc { 0 tiputs } def
803 }{ neg taproclin
804 } ifelse } ifelse } ifelse
805 } def
806 /SetVec { % tafro tatoo nta /vector | - : set /vector
807 4 1 roll
808 /nta x def /tatoo x def /tafro x def
809 /tastep tatoo tafro sub nta 1 sub div def
810 [
811 0 1 nta {
812 tastep mul tafro add /taloop x def
813 taproc exec
814 } for
815 ] def
816 } def
817 % set tick array - user commands
818 /SetTicVecLin { taproclin /TicVec SetVec } def
819 /SetTicVecLog { taproclog /TicVec SetVec } def
820
821 % set tack-and-number array
822 /SetTacVec { % [ pos {label} pos {label} ... ] | -
823 /TacVec x def
824 } def
825
826 % define axes
827 % note on angles : 0 = x-axis, 90 = y-axis
828 /OneAxx { % fro to xpos ypos aang tang | - : presets for Axx, Tic, Tac, Num
829 % store arguments
830 /tAng x def /aAng x def
831 /yPos x def /xPos x def
832 /aTo x def /aFro x def
833 % set constants
834 /xTicLen tAng cos xyTicLen mul def /yTicLen tAng sin xyTicLen mul def
835 /xTacLen tAng cos xyTacLen mul def /yTacLen tAng sin xyTacLen mul def
836 /xAng aAng cos def /yAng aAng sin def
837 /aMean aFro aTo add 2 div def
838 } def
839
840 % draw axis (with parameters preset by OneAxx or ArrAxx)
841 /Axx { % - | -
842 linsetAxx
843 gsave
844 xPos yPos offset
845 mmscale
846 aAng rotate
847 % draw a line
848 aFro 0 np mv
849 aTo 0 li st
850 grestore
851 } def
852
853 % draw ticks (positions given by SetTicVec, parameters preset by OneAxx/..)
854 /Tic { % - | - : draw tick as defined in TicProc
855 linsetTic
856 TicVec {
857 dup dup aFro lt x aTo gt or {pop} {TicProc} ifelse
858 } forall
859 } def
860 /TicProc { % aPos | - : default procedure to plot one tick
861 np
862 xPos yPos xym mv
863 dup xAng mul x yAng mul xym rm % eat argument, go to start pos.
864 xTicLen yTicLen rl st
865 } def
866 /xGric { % yFro yTo | - : draw a grid line (instead of an x tick)
867 linsetGri
868 TicVec {
869 3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
870 dup % y1 y2 x x
871 4 -1 roll xym np mv % y2 x
872 x xym li st
873 } ifelse
874 } forall
875 pop pop
876 } def
877 /yGric { % xFro xTo | - : draw a grid line (instead of an y tick)
878 linsetGri
879 TicVec {
880 3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
881 dup % x1 x2 y y
882 4 -1 roll x xym np mv % x2 y
883 xym li st
884 } ifelse
885 } forall
886 pop pop
887 } def
888
889 % draw tacks (positions given by SetTacVec, parameters preset by OneAxx/..)
890 /TacExe { % Proc | - % Execute Proc for all pairs of elements of TacVec
891 % (but only if inside aFro..aTo)
892 /TacProc x def
893 /ispair true def % toggle: take pos, take label, take pos, take label ...
894 TacVec {
895 ispair
896 {
897 /aPos x def
898 /ispair false def
899 } {
900 aPos dup aFro lt x aTo gt or
901 {pop} {TacProc} ifelse
902 /ispair true def
903 } ifelse
904 } forall
905 } def
906 /Tac {
907 linsetTac
908 { pop xPos yPos xym mv
909 aPos dup xAng mul x yAng mul xym rm
910 xTacLen yTacLen rl st
911 } TacExe
912 } def
913 % special tack routines, only for rectangular axes
914 /xTacC { % : centered tack on x axis
915 linsetTac
916 { pop aPos xm yPos ym txllen 2 div sub np mv 0 txllen rl st } TacExe
917 } def
918 /xGrid { % : rule instead of tack on x axis
919 linsetTac
920 { pop aPos xm np yPos ym mv 0 10 xym rl st } TacExe
921 } def
922 /yTacC { % : centered tack on y axis
923 linsetTac
924 { pop xPos xm tyllen 2 div sub aPos ym np mv tyllen 0 rl st } TacExe
925 } def
926 /yGrid { % : rule instead of tack on low y axis
927 linsetTac
928 { pop aPos ym np xPos xm x mv 10 0 xym rl st } TacExe
929 } def
930
931 % draw numbers (pos-txt pairs given by SetTacVec)
932 /Num { % Generic but useless. Adjust for your application.
933 setnum
934 fontheight ymm div yDisRel mul tAng sin mul /yDist x def
935 { dup textW xDisRel mul tAng cos mul /xDist x def
936 xPos aPos xAng mul add xDist sub
937 yPos aPos yAng mul add yDist sub 3 2 roll textCM
938 } TacExe
939 } def
940 /setnumDisRel { % xDisRel yDisRel | - : adjust just a little bit
941 /yDisRel x def /xDisRel x def
942 } def
943 1.2 1.2 setnumDisRel % default setting
944 % explicit Num routines for rectangular case
945 /xNumL { % : numbers on low x axis
946 setnum
947 { fontheight ymm div % conversion -> user_scale
948 dup /xNumHeightL x def
949 -.6 mul yPos add aPos x 3 2 roll textCT
950 } TacExe
951 } def
952 /xNumH { % : numbers on high x axis
953 setnum
954 { fontheight ymm div % conversion -> user_scale
955 dup /xNumHeightH x def
956 .6 mul yPos add aPos x 3 2 roll textCB
957 } TacExe
958 } def
959 /yNumL { % : numbers on low y axis
960 setnum
961 { fontsize -.3 mul xmm div xPos add aPos 3 2 roll textRM
962 xwidth dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
963 } TacExe
964 } def
965 /yNumLD { % : calculate only yNumLength (used for adjustement)
966 setnum
967 { textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
968 } TacExe
969 } def
970 /yDumL { % {(..)} yDumL : compare yNumLength with one arg (used for adjustement)
971 setnum
972 textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
973 } def
974 /yNumH { % : numbers on high y axis
975 setnum
976 { fontsize .3 mul xmm div xPos add aPos 3 2 roll textLM
977 xwidth dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
978 } TacExe
979 } def
980 /yNumHD { % : calculate only yNumLength (used for adjustement)
981 setnum
982 {textW dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
983 } TacExe
984 } def
985 /yDumH { % {(..)} yDumH : compare yNumLength with one arg (used for adjustement)
986 setnum
987 textW dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
988 } def
989
990 % draw labels
991 /xCL { % xlabel | - ; plots coordinate name below the x-axis.
992 setlab
993 aMean xNumHeightL xNumHeightRel neg mul
994 3 -1 roll textCT
995 } def
996 /xCH { % xlabel | - ; plots coordinate name above the x-axis.
997 setlab
998 aMean xNumHeightH xNumHeightRel mul 10 add
999 3 -1 roll textCB
1000 } def
1001 /yCL { % ylabel | - ; plots coordinate name to the left of the y-axis.
1002 gsave
1003 setlab
1004 yNumLengthL neg fontsize -.85 mul add % yNumLengthL calculated in yN
1005 aMean ym translate
1006 0 0 mv
1007 90 rotate
1008 0 x 0 x textCB
1009 grestore
1010 } def
1011 /YCH { % ylabel xpos | - ; plots coordinate name to the right of a vertical axis
1012 gsave
1013 setlab
1014 yNumLengthH fontsize .85 mul add x xm add
1015 aMean ym translate
1016 0 0 mv
1017 90 rotate
1018 0 x 0 x textCT
1019 grestore
1020 } def
1021 /yCH { 10 YCH } def % ylabel | - ; plots coordinate name to the right of the y-axis.
1022 /yCF { % ylabel | - ; plots coordinate name *falling* right of the y-axis.
1023 gsave
1024 setlab
1025 yNumLengthH fontsize .85 mul add 10 xm add
1026 aMEan ym translate
1027 0 0 mv
1028 -90 rotate
1029 0 x 0 x textCB
1030 grestore
1031 } def
1032
1033 /knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis
1034 % the total height of the generated object is y_tot
1035 % of which y_knau(.le. y_tot) is for the real knautsch,
1036 % the remainder is for vertical prolongations.
1037 x ym 4 div dup /tmpy x def 5 sqrt mul /tmpx x def
1038 /tmpa x ym tmpy 4 mul sub 2 div def
1039 np ym x xm x mv 0 tmpa rl tmpx tmpy rl tmpx -2 mul tmpy 2 mul rl
1040 tmpx tmpy rl 0 tmpa rl st
1041 } def
1042 /separy { % x0 y0 sep lng ang lin - : insert an // in dived y-axis
1043 setline
1044 /spang x def
1045 /splng x def
1046 /spsep x def
1047 2 copy spsep sub gsave offset spang rotate
1048 splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
1049 spsep add gsave offset spang rotate
1050 splng -.5 mul fm 0 np mv splng fm 0 rl st grestore
1051 } def
1052
1053 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1054 %% Data Plotting (Symbols and Curves) %%
1055 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1056
1057 %% Initializations:
1058
1059 % asymmetric error bars?
1060 /err_asy false def % overwrite this if data are quadruples x y d- d+
1061
1062 %% Presets:
1063
1064 % global preset
1065 /SymGSet { % sradglo slinglo serrglo | -
1066 /serrglo x def % plot error bars? 0=never, 1=always, 2=as_given_in_pset
1067 /slinglo x def % symbol linewidth multiplier
1068 /sradglo x def % symbol size multiplier
1069 } def
1070
1071 %% Retrieve presets from style array:
1072
1073 /pstyle { pStyles setstyle } def
1074 /cstyle { cStyles setstyle } def
1075 /setstyle { % chosen_number array | - : set p or c as predefined in array.
1076 dup length % i A n
1077 3 2 roll % A n i
1078 dup 0 le {
1079 pop pop pop ostyle % chosen_number<=0 means: don't plot
1080 } {
1081 1 sub x % A i-1 n
1082 mod get % A(i-1)
1083 exec
1084 } ifelse
1085 } def
1086
1087 %% Set plot symbol:
1088
1089 /pset { % styp sfill serr srad slin | -
1090 % arg -> symbol linewidth
1091 /slin x slinglo mul def
1092 % arg -> symbol size
1093 /srad x fm 0.16 mul sradglo mul def
1094 % arg -> plot error bar?
1095 2 serrglo ne { pop serrglo } if % if (serrglo=2) use serr else use serrglo
1096 /plot_errorbar x 1 eq { { errorbar } } { { pop pop pop pop } } ifelse def
1097 % arg -> fill the symbol? (0=open, 1=full, 2=colored_with_black_border)
1098 /sfill x def
1099 % adjust srad: it's the _outer_ radius
1100 % TROUBLE sfill 1 ne {/srad srad slin fm pt sub def} if
1101 % arg -> symbol type
1102 /ps {ps_nil} def % default: don't plot (maybe we only want an error bar)
1103 dup 1 eq {/ps {ps_square} def} if
1104 dup 2 eq {/ps {ps_diamond} def} if
1105 dup 3 eq {/ps {ps_circle} def} if
1106 dup 4 eq {/ps {ps_triangle} def} if
1107 dup 5 eq {/ps {ps_cedez} def} if
1108 dup 6 eq {/ps {ps_eieruhr} def} if
1109 dup 7 eq {/ps {ps_valve} def} if
1110 dup 8 eq {/ps {ps_tfwd} def} if
1111 dup 9 eq {/ps {ps_tbwd} def} if
1112 dup 10 eq {/ps {ps_pentagram} def} if
1113 dup 11 eq {/ps {ps_plus} def} if
1114 dup 12 eq {/ps {ps_cross} def} if
1115 dup 13 eq {/ps {ps_star} def} if
1116 dup 14 eq {/ps {ps_pentagon} def} if
1117 dup 15 eq {/ps {ps_horiz} def} if
1118 dup 16 eq {/ps {ps_verti} def} if
1119 pop
1120 %
1121 /t { % x y d[- d+] | - : plot a symbol and eventually an error bar.
1122 err_asy not { dup } if
1123 4 copy pop pop plot_symbol
1124 plot_errorbar
1125 } bind def
1126 /ti { t } bind def
1127 /tf { t black } bind def
1128 } def
1129
1130 %% Set curve:
1131
1132 /lset { % lwidth dashes | -
1133 0 setdash
1134 dup 0 gt {
1135 pt fm setlinewidth
1136 % pop error bar and convert frame coord -> paper coord
1137 /txy { err_asy { pop } if pop xym } def % x y d[- d+] | x' y'
1138 % commands to plot points (can be overwritten by nopoints):
1139 /ti { np txy mv } def % x y d[- d+] | - : start curve
1140 /t { txy li } def % x y d[- d+] | - : continue curve
1141 /tf { txy li st } def % x y d[- d+] | - : terminate and plot curve
1142 } {
1143 ostyle
1144 } ifelse
1145 } def
1146
1147 %% Plot nothing:
1148
1149 /ostyle { % - | -
1150 /ti { nopoint } def
1151 /t { nopoint } def
1152 /tf { nopoint } def
1153 } def
1154 /nopoint { % x y d[- d+] | -
1155 pop pop pop err_asy { pop } if
1156 } def
1157
1158 %% Plot an asymmetric vertical error bar:
1159
1160 /errorbar { % x y d- d+ | -
1161 gsave
1162 slin setline
1163 3 copy pop pop
1164 dup 0 gt x 10 lt and {
1165 4 copy
1166 x pop add 10. 2 copy gt { x } if pop ym x xm x
1167 2 copy x .05 sub x np mv .1 0 rl st
1168 np mv
1169 pop sub 0. 2 copy lt { x } if pop ym x xm x
1170 2 copy lineto st
1171 x .05 sub x np mv .1 0 rl st
1172 } {
1173 pop pop pop pop
1174 } ifelse
1175 grestore
1176 } def
1177
1178 %% Plot a data symbol:
1179
1180 /plot_symbol { % x y | -
1181 gsave
1182 offset
1183 srad dup scale
1184 slin srad div setline % factor 1/srad compensates "scale"
1185 ps % the actual plot symbol, defined by 'pset'
1186 grestore
1187 } def
1188
1189 /fill_symbol {
1190 sfill dup
1191 0 eq {
1192 pop st
1193 } {
1194 1 eq {
1195 fill
1196 } {
1197 gsave fill grestore
1198 gsave black st grestore
1199 } ifelse
1200 } ifelse
1201 } def
1202
1203 %% The different symbols, designed for unit area (no arguments):
1204
1205 /ps_nil {
1206 } bind def
1207
1208 /ps_square {
1209 .5 .5 np mv
1210 0 -1 rl
1211 -1 0 rl
1212 0 1 rl cp fill_symbol
1213 } bind def
1214
1215 /ps_diamond {
1216 gsave 45 rotate ps_square grestore
1217 } bind def
1218
1219 /ps_circle {
1220 0 0 np .564 0 360 arc cp fill_symbol
1221 } bind def
1222
1223 /ps_triangle {
1224 .77 dup dup 90 pol2xy np mv
1225 210 pol2xy li
1226 330 pol2xy li cp fill_symbol
1227 } bind def
1228
1229 /ps_cedez {
1230 gsave 180 rotate ps_triangle grestore
1231 } bind def
1232
1233 /ps_tfwd {
1234 gsave 30 rotate ps_triangle grestore
1235 } bind def
1236
1237 /ps_tbwd {
1238 gsave 210 rotate ps_triangle grestore
1239 } bind def
1240
1241 /ps_eieruhr {
1242 -.7 -.7 np mv
1243 .7 -.7 li
1244 -.7 .7 li
1245 .7 .7 li cp fill_symbol
1246 } bind def
1247
1248 /ps_valve {
1249 gsave 90 rotate ps_eieruhr grestore
1250 } bind def
1251
1252 /ps_pentagram {
1253 .8 dup dup dup dup
1254 90 pol2xy np mv
1255 234 pol2xy li
1256 18 pol2xy li
1257 162 pol2xy li
1258 306 pol2xy li cp fill_symbol
1259 } bind def
1260
1261 /ps_pentagon {
1262 .8 dup dup dup dup
1263 18 pol2xy np mv
1264 90 pol2xy li
1265 162 pol2xy li
1266 234 pol2xy li
1267 306 pol2xy li cp fill_symbol
1268 } bind def
1269
1270 /ps_plus {
1271 gsave 45 rotate ps_cross grestore
1272 } bind def
1273
1274 /ps_cross {
1275 .5 .5 np mv
1276 -1 -1 rl st
1277 -.5 .5 np mv
1278 1 -1 rl st
1279 } bind def
1280
1281 /ps_star {
1282 .7 dup 0 pol2xy np mv 180 pol2xy li st
1283 .7 dup 120 pol2xy np mv 300 pol2xy li st
1284 .7 dup 240 pol2xy np mv 60 pol2xy li st
1285 } bind def
1286
1287 /ps_horiz {
1288 -.7 0 np mv
1289 1.4 0 rl st
1290 } bind def
1291
1292 /ps_verti {
1293 0 -.7 np mv
1294 0 1.4 rl st
1295 } bind def
1296
1297 %% Set column plotting (use this instead of pset)
1298 /setcolumn{ % shift width exec | %
1299 % usage: 0 .2 { gsave { .5 setgray fill } grestore cp } setcolumn
1300 /colexec x def
1301 /colwidth x xm def
1302 /colshift x xm def
1303 /t {
1304 pop xym
1305 np x colshift add colwidth 2 div sub dup 3 2 roll mv
1306 colwidth 0 rl
1307 colwidth add 0 li
1308 colwidth neg 0 rl
1309 cp colexec
1310 } def
1311 /ti { t } bind def
1312 /tf { t black } bind def
1313 } def
1314
1315 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1316 %% 2D plots %%
1317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1318
1319 /t2d {
1320 icCol rect fill
1321 black
1322 } def
1323
1324 /t2p {
1325 icCol 0 t
1326 black
1327 } def
1328
1329 /ColorLegend { % - | - [plot color legend to rectangle hxlow hxhig 0 10]
1330 /ncol 100 def
1331 1 1 ncol {
1332 dup ncol div 10 mul icCol
1333 dup ncol div 10 mul
1334 x 1 sub ncol div 10 mul
1335 hxlow hxhig 4 2 roll rect fill
1336 } for
1337 } def
1338 /hColorLegend { % ditto, horizontally, to rectangle 0 10 hylow hyhig
1339 /ncol 100 def
1340 1 1 ncol {
1341 dup ncol div 10 mul icCol
1342 dup ncol div 10 mul
1343 x 1 sub ncol div 10 mul
1344 hylow hyhig rect fill
1345 } for
1346 } def
1347 % Usage:
1348 % hColorLegend
1349 % hylow hyhig 0 0 90 0 OneAxx Axx
1350 % hylow hyhig 10 0 90 180 OneAxx Axx
1351 % 0 10 0 hyhig 0 90 OneAxx Axx Tic Tac
1352 % 0 10 0 0 0 90 OneAxx Axx Tic Tac xNumL
1353 % {(intensity)} xCL
1354
1355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1356 %% Boxes
1357 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1358
1359 /rect { % xl xh yl yh | - [path -> rectangle]
1360 ym /qqyh x def
1361 ym /qqyl x def
1362 xm /qqxh x def
1363 xm /qqxl x def
1364 np
1365 qqxl qqyl mv
1366 qqxh qqyl li
1367 qqxh qqyh li
1368 qqxl qqyh li
1369 cp
1370 } def
1371 /oval { % xl xh yl yh dr | - [path -> oval]
1372 fm /qqdr x def
1373 ym /qqyh x def
1374 ym /qqyl x def
1375 xm /qqxh x def
1376 xm /qqxl x def
1377 qqxl qqyl qqdr add np mv
1378 qqxl qqyh qqdr sub li
1379 qqxl qqdr add qqyh qqdr sub qqdr 180 90 arcn
1380 qqxh qqdr sub qqyh li
1381 qqxh qqdr sub qqyh qqdr sub qqdr 90 0 arcn
1382 qqxh qqyl qqdr add li
1383 qqxh qqdr sub qqyl qqdr add qqdr 0 -90 arcn
1384 qqxl qqdr add qqyl li
1385 qqxl qqdr add qqyl qqdr add qqdr -90 -180 arcn
1386 cp
1387 } def
1388
1389 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1390 %% Motifs %%
1391 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1392
1393 /dot { % x y siz
1394 0 360 np arc cp fill
1395 } def
1396
1397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1398 %% List %%
1399 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1400
1401 /NewList { % xins yins size advance NewList -
1402 /nl_advance x def setown /nl_yins x def /nl_xins x def
1403 /nl_yorig nl_yins def
1404 /nl_xshift fontsize xmm div .9 mul def
1405 /nl_xrline 0.33 def
1406 /nl_ystep fontheight ymm div nl_advance mul def
1407 /newline {
1408 /nl_yins nl_yins nl_ystep sub def
1409 } def
1410 /fracline { % frac | -
1411 fontheight ymm div nl_advance mul mul /nl_yins x nl_yins x sub def
1412 } def
1413 } def
1414 /newlist { 1.65 NewList } def
1415 /nlbox { % width | xl xh yl yh
1416 nl_xins add nl_xins fontwidth .4 mul sub x
1417 nl_yins nl_ystep add fontheight 1.2 mul sub nl_yorig fontheight 1.2 mul add
1418 } def
1419 /TxLine { % text | -
1420 nl_xins nl_yins 3 -1 roll textLM newline
1421 } bind def
1422 /TxCLine { % text | -
1423 nl_xins nl_yins 3 -1 roll textCM newline
1424 } bind def
1425 /PtTxLine { % pstyle text | -
1426 x pstyle
1427 nl_xins nl_xshift .5 mul add nl_yins 0 t
1428 black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
1429 newline
1430 } bind def
1431 /PttttTxLine { % pstyle text | - %% chain of very small symbols
1432 x pstyle
1433 nl_xins nl_xshift .10 mul add nl_yins 0 t
1434 nl_xins nl_xshift .26 mul add nl_yins 0 t
1435 nl_xins nl_xshift .42 mul add nl_yins 0 t
1436 nl_xins nl_xshift .58 mul add nl_yins 0 t
1437 nl_xins nl_xshift .74 mul add nl_yins 0 t
1438 nl_xins nl_xshift .90 mul add nl_yins 0 t
1439 black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
1440 newline
1441 } bind def
1442 /PtPtCvTxLine { % pstyle pstyle cstyle text | -
1443 4 3 roll pstyle nl_xins nl_yins 0 t
1444 3 2 roll pstyle nl_xins nl_xshift add nl_yins 0 t
1445 x cstyle
1446 nl_xins nl_xshift 2 mul add
1447 dup dup nl_xshift nl_xrline mul sub nl_yins 0 ti
1448 nl_xshift nl_xrline mul add nl_yins 0 tf
1449 nl_xshift add nl_yins 3 2 roll black textLM
1450 newline
1451 } bind def
1452 /PtCvTxLine { % pstyle cstyle text | -
1453 3 2 roll pstyle nl_xins nl_yins 0 t
1454 x cstyle
1455 nl_xins nl_xshift 1 mul add
1456 dup dup nl_xshift -.33 mul add nl_yins 0 ti
1457 nl_xshift 0.33 mul add nl_yins 0 tf
1458 nl_xshift add nl_yins 3 2 roll black textLM
1459 newline
1460 } bind def
1461 /PtPtTxLine { % pstyle pstyle text | -
1462 3 2 roll pstyle nl_xins nl_yins 0 t
1463 x pstyle nl_xins nl_xshift add nl_yins 0 t
1464 black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
1465 newline
1466 } bind def
1467 /CvTxLine { % cstyle text | -
1468 x cstyle
1469 nl_xins fontsize xmm div nl_xrline mul 0 mul sub nl_yins 0 ti
1470 nl_xins fontsize xmm div nl_xrline mul 3 mul add nl_yins 0 tf
1471 black nl_xins nl_xshift 1.5 mul add nl_yins 3 2 roll textLM
1472 newline
1473 } bind def
1474 /Cv2TxLine { % cstyle text | -
1475 x cstyle
1476 nl_xins fontsize xmm div nl_xrline mul sub nl_yins 0 ti
1477 nl_xins fontsize xmm div nl_xrline mul add nl_xshift add nl_yins 0 tf
1478 black nl_xins nl_xshift 2 mul add nl_yins 3 2 roll textLM
1479 newline
1480 } bind def
1481 /PCTxLine { % pstyle(with plset) text | -
1482 x pstyle
1483 nl_xins fontsize xmm div nl_xrline 2 mul mul sub nl_yins 0 ci
1484 nl_xins fontsize xmm div nl_xrline 2 mul mul add nl_yins 0 cf
1485 nl_xins yins 0 t
1486 black nl_xins
1487 fontsize xmm div 1.9 mul % instead of xshift
1488 add nl_yins 3 2 roll textLM
1489 newline
1490 } bind def
1491 /infSet { % oooinfo | - : set whether(1) or not(0) to plot info block
1492 /oooinfo x def
1493 } def
1494
1495 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1496 %% Arrows
1497 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1498
1499 /pfeilangle 36.87 def
1500 /pfeilspitze { % x[local] y[local] rot siz
1501 % draw with current linestyle, as set e.g. by linsetAxx
1502 x 4 2 roll % siz rot x y
1503 gsave
1504 xym translate 180 add rotate dup dup dup
1505 [] 0 setdash
1506 pfeilangle cos mul x pfeilangle sin mul np mv
1507 0 0 li pfeilangle cos mul x pfeilangle sin neg mul li st
1508 grestore
1509 } def
1510 /pfeiL { % (arrow anchored at base) x y rot siz len
1511 gsave
1512 dup xm x ym mul sqrt % (scale len)
1513 5 3 roll
1514 xym translate % (origin at base) rot siz len
1515 3 2 roll
1516 rotate % (draw rightwards) siz len
1517 dup 0 translate % (origin at head) siz len
1518 x 0 0 0 4 3 roll pfeilspitze % len
1519 0 0 np mv neg 0 li st
1520 grestore
1521 } def
1522 /Pfeil { % (arrow anchored at head) x y rot siz len
1523 dup xm x ym mul sqrt 5 copy
1524 pop pfeilspitze
1525 x pop
1526 x 4 2 roll % len rot x y
1527 gsave
1528 xym translate 180 add rotate
1529 0 0 np mv 0 li st
1530 grestore
1531 } def
1532 /pfeil { % xi xf yi yf siz
1533 gsave
1534 5 1 roll
1535 4 copy
1536 4 1 roll pop x pop x offset
1537 sub 3 1 roll sub x 2 copy
1538 x atan 180 add 3 1 roll
1539 0 0 np mv li st
1540 x 0 0 4 2 roll pfeilspitze
1541 grestore
1542 } def
1543
1544 /bemasz { % x y L ang text | - %% precede by '24 setown 1 [] lset /pfeilangle 90 def'
1545 gsave
1546 5 3 roll offset % consumes x and y
1547 x rotate % consumes ang | L text
1548 dup textw .5 mul fontheight .4 mul add /bmszDT x def % => half text width
1549 0 0 3 2 roll textCM % L
1550 .5 mul /bmszDX x def % => half bemasz length
1551 bmszDX 0 0 fontheight .67 mul bmszDX bmszDT sub Pfeil
1552 bmszDX neg 0 180 fontheight .67 mul bmszDX bmszDT sub Pfeil
1553 grestore
1554 } def
1555
1556 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1557 %% Text macros
1558 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1559
1560 /Celsius { showif (\26x)g(C) showif } bind def
1561 /hbar {
1562 showif
1563 (h) 1.2 .66 {
1564 currentpoint fontheight .11 mul setline np mv
1565 fontheight dup .8 mul x .3 mul rl
1566 st ()
1567 } build
1568 } bind def
1569
1570 %% for neutron scattering:
1571
1572 /hbarw { hbar () grec (w) endgr } bind def
1573 /wbar { grec (w) endgr ( / 2) grec (p) endgr } bind def
1574 /taumean { () (\341t\361) g } bind def
1575 /Sqw { showif (S\(q,) grec (w) endgr (\)) showif } bind def
1576 /Sqn { showif (S\(q,) grec (n) endgr (\)) showif } bind def
1577 /SQw { showif (S\(Q,) grec (w) endgr (\)) showif } bind def
1578 /Sttw { showif (S\(2) grec (q) endgr (,) grec (w) endgr (\)) showif } bind def
1579 /Sttn { showif (S\(2) grec (q) endgr (,) grec (n) endgr (\)) showif } bind def
1580 /Xqw { grec (c) endgr (''\(q,) grec (w) endgr (\)) showif } bind def
1581 /Xqn { grec (c) endgr (''\(q,) grec (n) endgr (\)) showif } bind def
1582 /ueV{ grec (m) endgr (eV) showif} bind def
1583 /inueV { showif (\() grec (m) endgr (eV\)) showif } bind def
1584 /inmeVr { showif (\(meV) supsc (-1) endsc (\)) showif } bind def
1585 /inueVr { showif (\() grec (m) endgr (eV)
1586 supsc (-1) endsc (\)) showif } bind def
1587 /inGHzr { showif (\(GHz) (-1) sp (\)) showif } def
1588 /inDeg { showif (\() (\260)g (\)) showif } def
1589
1590 /Angstr { showif (\305) showif } bind def
1591 /Angr { showif (\305) supsc (-1) endsc } bind def
1592 /inAngr { showif (\() Angr (\)) showif } bind def
1593 /Angrr { showif (\305) supsc (-2) endsc } bind def
1594 /inAngrr { showif (\() Angrr (\)) showif } bind def
1595 /wmin {grec (w) endgr () subsc (min) endsc} def
1596 /winpi { grec (w) endgr ( / 2) grec (p) endgr } def
1597
1598 end % WuGdict...
1599
1600 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1601 %% Mark "ewu", the end of the wups.. macro definition file %%
1602 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1603 WuGdict24a begin
1604
1605 7 dup autolabel defsiz
1606 1 dup stdred
1607 -1.5 -25 setnewpage newpage
1608 Resets
1609
1610 newpath
1611 2 8 moveto % lower-left corner
1612 22 0 rlineto % draw to lower-right
1613 0 12 rlineto % draw to upper-right
1614 -22 0 rlineto % draw to upper-left
1615 closepath
1616 clip
1617
1618 24 setown
1619 .8 setgray
1620 {
1621 0 1 45 {
1622 pop
1623 {
1624 0 1 50 {
1625 pop
1626 np 0 0 .07 0 360 arc cp fill
1627 .53 .17 offset
1628 } for
1629 } G
1630 .05 .48 offset
1631 } for
1632 } G
1633
1634 12 14 offset
1635 siemensblue 1 [] lset
1636 0 0 0 .5 7 pfeiL 7.3 0 {(x)} textLM
1637 0 0 90 .5 5 pfeiL 0 5.5 {(y)} textCB
1638 siemensred 1 [] lset
1639 { 27 rotate
1640 0 0 0 .5 5 1.2 mul pfeiL
1641 0 0 90 .5 5 .8 mul pfeiL
1642 black
1643 1.2 0.8 scale
1644 np 0 0 5 0 360 arc st
1645 } G
1646 siemensred
1647 5.7 2.9 {()(w)g()(x)sb()} textLM
1648 -2.17 4.1 {()(w)g()(y)sb()} textCB
1649 siemensgreen 2 [] lset
1650 np 0 0 2.7 0 27 arc st
1651 3.2 .9 {()(g)g()} textCM
1652
1653 showpage