Debian Codegraph @

hugo/static/img/draw/lattice2d.eps

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