-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlogo.ps
1597 lines (1445 loc) · 45.4 KB
/
logo.ps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%!PS-Adobe-1.0 EPSF-1.0
%%BoundingBox: 19 773 78 831
%%Comment: Bounding box extracted by bboxx
%%+: A program by Dov Grobgeld 2003
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% FRIDA: fast reliable interactive data analysis %%
%% wups18a.ps: graphic macros %%
%% (C) Joachim Wuttke 1990-2018 %%
%% http://www.messen-und-deuten.de/frida %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/WuGdict18a 400 dict def
WuGdict18a begin
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Generic and math operators
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Shortcuts:
/np { newpath } bind def
/mv { moveto } bind def
/rm { rmoveto } bind def
/rl { rlineto } bind def
/li { lineto } bind def
/cp { closepath } bind def
/st { stroke } bind def
/x { exch } bind def
/gs { gsave } bind def
/gr { grestore } bind def
/G { gsave exec grestore } bind def
%% Math operators:
/twopi { 6.2831853072 } def
/rnd { rand cvr 1 30 bitshift div 2 div 0 max 1 min } def % -> between 0 and 1
/min { 2 copy gt { x } if pop } def
/max { 2 copy lt { x } if pop } def
/tan { dup sin x cos div } def
/cot { dup cos x sin div } def
/pol2xy{ 2 copy cos mul 3 1 roll sin mul } def % r phi | x y
/eexp { 2.71828 x exp } def % "exp" is x^y, eexp is e^x
/tanh { 2.71828 x 2 copy exp 3 1 roll neg exp 2 copy sub 3 1 roll add div } def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Incremental path construction with persistent direction
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/NP { % x y [new path]
gsave translate np 0 0 mv } bind def
/EP { % [end path]
grestore } bind def
/L { % len rel_dir [line]
90 mul rotate 0 2 copy rl translate } bind def
/A { % radius angle [arc segment]
/IPCa x 90 mul def /IPCr x def
IPCa 0 lt
{
0 IPCr neg IPCr 90 90 IPCa add arcn
0 IPCr neg translate IPCa rotate 0 IPCr translate
} {
0 IPCr IPCr -90 -90 IPCa add arc
0 IPCr translate IPCa rotate 0 IPCr neg translate
} ifelse
} def
/V { % size [simple arrow] -
gsave /IPCr x def np -.8 IPCr mul .6 IPCr mul mv
0 0 li -.8 IPCr mul -.6 IPCr mul li st grestore
} def % size [arrow]
/Vc { % size [triangular unfilled arrow] -
gsave /IPCr x def np -.8 IPCr mul .6 IPCr mul mv
0 0 li -.8 IPCr mul -.6 IPCr mul li cp { white fill } G st grestore
} def %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Page coordinates
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/pt { .018567 mul} bind def % for line widths and font sizes, reason unclear
/cm {28.346456 mul} bind def % typographic_point -> cm
/cmtranslate { % x y [] -
cm x cm x translate } bind def
% Move origin from lower left (PostScript default) to upper left
/setnewpage { % xoff yoff
/yoffnewpage x def
/xoffnewpage x def
} def
/originUpperLeft_A4{ .7 28.3 cmtranslate } bind def
/goffsetA4 { ungscale originUpperLeft_A4 gscale } def
/newpage {
goffsetA4
xoffnewpage yoffnewpage offset
} def
% Set absolute global scale and relative symbol size
/defsiz { % size(cm) symbolsize(rel) | -
/ftot x def
/gsiz x cm 10 div def
gscale % within 'size', coordinates run from 0 to 10
} def
/gscale {
gsiz dup scale
} def
/ungscale {
1 gsiz div dup scale
} def
% Symbol (and label?) size as sublinear function of figure size
/autolabel { % size(cm) | symbolsize(rel)
dup 7 div 2 add 4 mul % the simplest sublinear increase
x div % anticipate overall rescaling
} def
% Aspect ratios
/gyld {0.447214 mul} bind def /Gyld {0.447214 div} bind def % sqrt(5)
/guld {0.547723 mul} bind def /Guld {0.547723 div} bind def % sqrt(3)
/gold {0.618034 mul} bind def /Gold {0.618034 div} bind def % goldener Schnitt
/gild {0.707107 mul} bind def /Gild {0.707107 div} bind def % sqrt(2) : DIN
/geld {0.759836 mul} bind def /Geld {0.759836 div} bind def % sqrt(sqrt(3))
/gald {0.817765 mul} bind def /Gald {0.817765 div} bind def % sqrt sqrt sqrt 5
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Several frames per page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/setpagegrid { % ncol nrow xoffnewframe yoffnewframe
/yoffnewframe x def
/xoffnewframe x def
/nrowpage x def
/ncolpage x def
} def
/iFrame 0 def
/nextFrame {
/iFrame iFrame 1 add def
iFrame nrowpage ncolpage mul mod 0 eq {
showpage gscale newpage
} {
iFrame ncolpage mod 0 eq {
xoffnewframe ncolpage 1 sub neg mul yoffnewframe offset
} {
xoffnewframe 0 offset
} ifelse
} ifelse
} def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Frame coordinates
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/defred { % x_reduction y_reduction label_reduction | -
/fmm x ftot mul def
/ymm x def
/xmm x def
% conversion frame_coordinate -> global_coord
/xm {xmm mul} bind def
/ym {ymm mul} bind def
/fm {fmm mul} bind def
/xym {ym x xm x} bind def
% prefer rescaling over explicit conversion (make more use of this !)
/mmscale { xmm ymm scale } bind def
/mmunscale { 1 xmm div 1 ymm div scale } bind def
% graphic commands in frame coordinates
/offset { xym translate } bind def
/currentxy { currentpoint ymm div x xmm div x } bind def
/setline { pt fm setlinewidth [] 0 setdash } bind def
} def
/stdred { % x_reduction y_reduction | -
2 copy mul sqrt defred
} def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% World (= user application) coordinates
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/xSetCoord { % log min max | -
/wxmax x def
/wxmin x def
/wxlog x 0 eq not def
/wxdel wxmax wxmin wxlog { div log } { sub } ifelse def
/wxd { % dx(world) | dx(frame)
wxlog { log } if wxdel div 10 mul
} bind def
/wx { % x(world) | x(frame)
wxmin wxlog { div } { sub } ifelse
wxd
} bind def
} def
/ySetCoord { % log min max | -
/wymax x def
/wymin x def
/wylog x 0 eq not def
/wydel wymax wymin wylog { div log } { sub } ifelse def
/wyd { % dy(world) | dy(frame)
wylog { log } if wydel div 10 mul
} bind def
/wy { % y(world) | y(frame)
wymin wylog { div } { sub } ifelse
wyd
} bind def
} def
/hSetCoord { % log min max | - % for use in 2D plot
/whmax x def
/whmin x def
/whlog x 0 eq not def
/wH { % h(world) | h(col)
dup whmin lt {
pop -1
} {
dup whmax gt {
pop 11
} {
wh
} ifelse
} ifelse
} bind def
whlog {
/whdel whmax whmin div log def
/wh { whmin div log whdel div 10 mul } bind def % h(world) | h(col)
} {
/whdel whmax whmin sub def
/wh { whmin sub whdel div 10 mul } bind def % h(world) | h(col)
} ifelse
} def
% pair conversion
/wxy { % x,y(world) -> x,y(frame)
wy x wx x
} def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Colors %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Color operators:
/setRGBcolor {
3 { 255 div 3 1 roll } repeat setrgbcolor
} def
/colormix { % weight(0..1) col1(R|G|B) col2(R|G|B) | col(R|G|B)
7 -1 roll dup /weightA x def /weightB x 1 x sub def
4 -1 roll weightA mul x weightB mul add 5 1 roll
3 -1 roll weightA mul x weightB mul add 4 1 roll
2 -1 roll weightA mul x weightB mul add 3 1 roll
} def
/relcol { % i_col n_col | rel(0..1) : for one-dimensional choices
1 sub div 0 max 1 min
} def
%% Named colors:
/black { 0 setgray } bind def
/white { 1 setgray } bind def
/red { 255 0 0 setRGBcolor } bind def
/siemensorange { 255 153 0 setRGBcolor } bind def
/siemensblue { 0 102 153 setRGBcolor } bind def
/siemenstext { 0 51 102 setRGBcolor } bind def
/siemensred { 165 0 33 setRGBcolor } bind def
/siemenspink { 221 102 102 setRGBcolor } bind def
/siemensgrey { 221 221 221 setRGBcolor } bind def
/siemensdark { 102 102 102 setRGBcolor } bind def
/siemensgreen { 33 153 102 setRGBcolor } bind def
/siemensyellow { 255 221 0 setRGBcolor } bind def
%% One-dimensional linear color choices:
/iCol1 { % i i_max | - : default -2010, round the circle, RGBR
relcol dup 1 x % rel 1 rel
360 mul 255 add cos 1 add dup mul neg .053 mul 1 add % modulate saturation
sethsbcolor
} def
/iCol2 { % i i_max | - : cyan - yellow - magenta
relcol 3 mul
dup 1 le {
dup 1 sub neg 0 3 2 roll } {
dup 2 le {
1 sub dup 1 sub neg 0 3 1 roll } {
2 sub dup 1 sub neg 0 3 0 roll } ifelse
} ifelse
0 setcmykcolor
} def
/iCol3 { % i i_max | - : siemens
div /icnow x def
165 1 icnow sub mul
102 icnow mul
33 120 icnow mul add setRGBcolor
} def
/iCol4 { % i i_max | - : red to blue (subsequence of old scheme iCol1)
relcol
3 x sub 3 div 1 iCol1
} def
%% One-dimensional color choice from given array:
/iColA { % i i_max arr | -
/aCol x def
relcol
aCol length 1 sub mul % position within array
dup cvi dup 3 1 roll % idx pos idx
sub x % offset idx
0 max aCol length 1 sub min % offset safe_idx
dup 1 add aCol length 1 sub min % offset i i+1
aCol x get exec
4 3 roll aCol x get exec colormix setRGBcolor
} def
%% ditto with discontinuous values for h<0 and h>1
/iColAA { % i i_max arr {low_col} {hig_col} | -
5 3 roll
div
dup 0 lt {
pop pop x pop exec
} {
dup 1 gt {
pop 3 1 roll pop pop exec
} {
1 % arr {l} {h} i i_max
5 2 roll pop pop
x 1 add x % ad-hoc correction for legacy definition of relcol
iColA
} ifelse
} ifelse
} def
%% Color arrays for non-linear one-dimensional choices:
/aCol1 [ % red-blue
{ 255 0 0 } % 1
{ 240 10 10 } % 2
{ 220 40 40 } % 3
{ 205 65 90 } % 4
{ 195 80 130 } % 5
{ 180 110 180 } % 6
{ 165 120 185 } % 7
{ 150 130 190 } % 8
{ 130 150 210 } % 9
{ 110 125 220 } % 10
{ 85 105 230 } % 11
{ 70 90 255 } % 12
{ 0 0 255 } % 13
] def
/aCol2 [ % orange-red-blue-darkblue
{ 255 180 0 }
{ 255 160 0 }
{ 255 120 0 }
{ 255 70 0 }
{ 255 0 0 }
{ 220 30 30 }
{ 220 70 60 }
{ 220 100 110 }
{ 200 130 130 }
{ 200 130 160 }
{ 180 110 180 }
{ 165 110 185 }
{ 150 130 190 }
{ 130 150 210 }
{ 100 120 220 }
{ 85 105 230 }
{ 70 90 255 }
{ 0 0 255 }
{ 0 0 180 }
{ 10 10 150 }
{ 30 30 130 }
] def
/aCol3 [ % [fixed size: max_i=8] siemenscolors
{ 165 0 33 } % siemensred
{ 33 153 102 } % siemensgreen
{ 0 102 153 } % siemensblue
{ 0 51 102 } % siemenstext
{ 255 153 0 } % siemensorange
{ 102 102 102 } % siemensdark
{ 255 221 0 } % siemensyellow
{ 221 221 221 } % siemensgrey
{ 221 102 102 } % siemenspink
] def
/aCol4 [ % green-blue-brown
{ 120 160 60 }
{ 90 185 40 }
{ 50 215 20 }
{ 0 245 0 }
{ 10 235 112 }
{ 20 235 143 }
{ 30 230 173 }
{ 40 225 194 }
{ 50 205 215 }
{ 40 153 204 }
{ 40 102 153 }
{ 40 82 122 }
{ 90 74 101 }
{ 140 68 80 }
{ 170 59 60 }
{ 190 50 40 }
{ 180 65 40 }
{ 160 80 40 }
{ 140 100 40 }
{ 120 80 30 }
{ 100 60 20 }
] def
/aCol5 [ % [fixed size: max_i=7] old gnuplot default (see man gnuplot and rgb.txt)
{ 255 0 0 } % red
{ 0 255 0 } % green
{ 0 0 255 } % blue
{ 255 0 255 } % magenta
{ 0 255 255 } % cyan
{ 160 82 45 } % sienna
{ 255 165 0 } % orange
{ 255 127 80 } % coral
] def
/aCol6 [ % heat plot
{ 100 0 100 } % violet
{ 60 30 130 } % dark blue
{ 30 50 220 } % blue
{ 50 150 100 } % green
{ 150 200 100 } % green
{ 215 255 50 } % green/yellow
{ 255 255 0 } % yellow
{ 255 125 0 } % orange
{ 255 0 0 } % red
] def
/aCol7 [ % [fixed size: max_i=8] default colors, modified from old gnuplot
{ 80 80 255 } % blue
{ 255 0 0 } % red
{ 0 160 0 } % dark green
{ 255 0 255 } % magenta
{ 0 160 192 } % dark cyan
{ 160 82 45 } % sienna
{ 255 165 0 } % orange
{ 255 127 80 } % coral
{ 64 224 32 } % light greenish
] def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Fonts
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% extend font encoding
/ReEncode { % OldFont NewFont Encoding | -
/MyEncoding x def
x findfont % select OldFont
dup length dict begin
{def} forall
/Encoding MyEncoding def
currentdict
end
definefont pop % define as NewFont
} def
% we assume that image scripts are Latin1 encoded
/Helvetica /MyFont ISOLatin1Encoding ReEncode
/Helvetica-Oblique /MyFont-Oblique ISOLatin1Encoding ReEncode
/Helvetica-Bold /MyFont-Bold ISOLatin1Encoding ReEncode
/Helvetica-BoldOblique /MyFont-BoldOblique ISOLatin1Encoding ReEncode
/setPalatino {
/Palatino /MyFont ISOLatin1Encoding ReEncode
/Palatino-Italic /MyFont-Oblique ISOLatin1Encoding ReEncode
/Palatino-Bold /MyFont-Bold ISOLatin1Encoding ReEncode
/Palatino-BoldItalic /MyFont-BoldOblique ISOLatin1Encoding ReEncode
} def
%% Preset standard styles:
% scale and set font; define fontsize, fontheight
/setfontandsize { % font size | -
dup 0 le { pop 100 } if % fontsize <= 0 not allowed !
/fontnonnil true def
pt fm dup /fontsize x def
x findfont
x scalefont
setfont
gsave % determine fontheight - from the cookbook :
np 0 0 mv (W) true charpath flattenpath
pathbbox % low_left_x, low_left_y, up_right_x, up_right_y
/fontheight x def
/fontwidth x def
pop pop
grestore
} def
% standard settings for labelling axes
/numlabcol { black } def
/setnum { /MyFont 24 setfontandsize numlabcol } def
/setlab { /MyFont 24 setfontandsize numlabcol } def
% user commands (free choice of fontsize, but fixed font family)
/setown { /MyFont x setfontandsize } def
/setbol { /MyFont-Bold x setfontandsize } def
/setboq { /MyFont-BoldOblique x setfontandsize } def
/setobl { /MyFont-Oblique x setfontandsize } def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Text blocks
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/showif { % string | - : increment xwidth or plot string
prepare
{ stringwidth pop xwidth add /xwidth x def }
{ show }
ifelse
} def
/script { % matrix relpos_y | -
/yoffset x fontheight mul def
currentfont x makefont setfont
0 yoffset rm
} def
/scred .71 def
/subsc {
showif
[scred 0 0 scred 0 0] -.2 script
} def
/supsc {
showif
[scred 0 0 scred 0 0] .6 script
} def
/endsc {
showif
regularfont setfont
0 yoffset neg rm
} def
/grec {
showif
/Symbol findfont fontsize scalefont setfont
} def
/endgr {
showif
regularfont setfont
} def
/endall {
showif
regularfont setfont
} def
/build { % string xrel yrel obj | - : plot obj above/below string
/obj x def /yrelbui x def /xrelbui x def
dup showif
prepare
{ pop }
{ stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
currentpoint 4 2 roll % save position after string
rm obj pop % obj must end with () that will be pop'ed
mv % back to saved position
}
ifelse
} def
/gbuild { % string xrel yrel obj | - : plot obj above/below string
/obj x def /yrelbui x def /xrelbui x def
/Symbol findfont fontsize scalefont setfont
dup showif
prepare
{ pop regularfont setfont }
{ stringwidth pop xrelbui neg mul fontheight yrelbui mul % relpos for obj
currentpoint 4 2 roll % save position after string
regularfont setfont
rm obj pop % obj must end with () that will be pop'ed
mv % back to saved position
}
ifelse
} def
/hut { % ..) (<Char>) hut (.. %%% MISERABEL PROGRAMMIERT
x showif
1.4 .6 {(\136) show ()} build
} def
/ghut { % ..) (<grec-Char>) ghut (.. %%% BREITE PASST NUR FUER Phi(t)
x showif
.8 .65 {(\136) show ()} gbuild
} def
/tilde {
x showif
1. .6 {(~) show ()} build
} def
/gtilde {
x showif
1. .6 {(~) show ()} gbuild
} def
/spce { % string n spce - ; insert n times ( )
{showif ( )} repeat
} def
% the following macros use the symbol/curve plotting mechanism
/pins { % string symins - ; symbol must be selected by pset
showif
( ) showif ( ) .5 .5 { currentxy 0 p black ()} build ( ) showif
} def
/clenins { % string len clenins - ; curve must be selected by cset
x showif % I suppose that pins is preceeded by 8 spaces
dup ( ) stringwidth pop mul 2 add /xstrich x xmm div def
% length of inserted curve :
% -1 space : curve begins and ends in middle of ( )
% +3 spaces: pins requires 3 times ( )
( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
2 add {( ) showif} repeat
} def
/cins { % string symins - ; curve must be selected by cset
showif 8 % I suppose that pins is preceeded by 8 spaces
dup ( ) stringwidth pop mul 2 add /xstrich x xmm div 10 div def
% nov03, ohne zu verstehen, "10 div" eingefuegt
% length of inserted curve :
% -1 space : curve begins and ends in middle of ( )
% +3 spaces: pins requires 3 times ( )
( ) 0 .5 { currentxy currentxy 0 ci x xstrich add x 0 cf () } build
2 add {( ) showif} repeat
} def
/block { % x y ob xrel yrel | -
/yrel x def /xrel x def /blabla x def
/ypos x ym def /xpos x xm def
/regularfont currentfont def /yoffset 0 def % initialize for security
/prepare true def /xwidth 0 def 0 0 mv % to prevent empty-path-error
blabla endall % first pass : determine xwidth
boxif { /boxwidth xwidth (M) stringwidth pop boxxr mul 2 mul add def
/boxheight fontheight 1 boxyr 2 mul add mul def
np xpos xwidth xrel mul sub boxwidth xwidth sub 2 div sub
ypos fontheight .5 boxyr add mul sub mv
boxwidth 0 rl 0 boxheight rl boxwidth neg 0 rl cp
boxproc
} if
xpos xwidth xrel mul sub ypos fontheight yrel mul sub mv
/prepare false def
blabla endall % second pass : plot
/boxif false def
} def
/rblock { % x y ang ob proc rblock -
5 3 roll
gsave
xym translate
3 2 roll rotate
0 0 4 2 roll exec
grestore
} def
/Box { % x y {exe}
/boxif true def
/boxproc x def /boxyr x def /boxxr x def
} def
/nBox { .6 .6 3 2 roll Box } def
/boxif false def
/textW { % obj | length : calculate only length.
/blabla x def
/regularfont currentfont def /yoffset 0 def % initialize for security
/prepare true def /xwidth 0 def 0 0 mv % to prevent empty-path-error
blabla endall
xwidth % has been determined
} def
/textw { % obj | y : dito, in 0..10-units
textW xmm div
} def
% horizontal text: x y ob | -
/textLB { 0. 0. block } bind def
/textCB { .5 0. block } bind def
/textRB { 1. 0. block } bind def
/textLM { 0. .5 block } bind def
/textCM { .5 .5 block } bind def
/textRM { 1. .5 block } bind def
/textLT { 0. 1. block } bind def
/textCT { .5 1. block } bind def
/textRT { 1. 1. block } bind def
% rotated text: x y ang ob | -
/rtextLB { {textLB} rblock } bind def
/rtextLM { {textLM} rblock } bind def
/rtextRB { {textRB} rblock } bind def
/rtextRM { {textRM} rblock } bind def
/rtextCM { {textCM} rblock } bind def
%% Language selection:
% preset
/language { % choose_this of_so_many | - % select current language
/langMax x def
/langChc x def
} def
1 1 language % default
% choose text from sequence
/langSel { % text_1 .. text_M | text_C : choose text, M=langMax, C=langChc
langMax dup langChc sub 1 add roll
langMax 1 sub { pop } repeat
} def
%% Text composition shortcuts:
/g { x grec endgr} bind def
/sb { x subsc endsc} bind def
/sp { x supsc endsc} bind def
/sbgr { x grec () subsc endsc () endgr} bind def
/spgr { x grec () supsc endsc () endgr} bind def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Text macros
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/Celsius { showif (\26x)g(C) showif } bind def
/hbar {
showif
(h) 1.2 .66 {
currentpoint fontheight .11 mul setline np mv
fontheight dup .8 mul x .3 mul rl
st ()
} build
} bind def
%% for neutron scattering:
/hbarw { hbar () grec (w) endgr } bind def
/wbar { grec (w) endgr ( / 2) grec (p) endgr } bind def
/taumean { () (\341t\361) g } bind def
/Sqw { showif (S\(q,) grec (w) endgr (\)) showif } bind def
/Sqn { showif (S\(q,) grec (n) endgr (\)) showif } bind def
/SQw { showif (S\(Q,) grec (w) endgr (\)) showif } bind def
/Sttw { showif (S\(2) grec (q) endgr (,) grec (w) endgr (\)) showif } bind def
/Sttn { showif (S\(2) grec (q) endgr (,) grec (n) endgr (\)) showif } bind def
/Xqw { grec (c) endgr (''\(q,) grec (w) endgr (\)) showif } bind def
/Xqn { grec (c) endgr (''\(q,) grec (n) endgr (\)) showif } bind def
/ueV{ grec (m) endgr (eV) showif} bind def
/inueV { showif (\() grec (m) endgr (eV\)) showif } bind def
/inmeVr { showif (\(meV) supsc (-1) endsc (\)) showif } bind def
/inueVr { showif (\() grec (m) endgr (eV)
supsc (-1) endsc (\)) showif } bind def
/inGHzr { showif (\(GHz) (-1) sp (\)) showif } def
/Angstr { showif (\305) showif } bind def
/Angr { showif (\305) supsc (-1) endsc } bind def
/inAngr { showif (\() Angr (\)) showif } bind def
/Angrr { showif (\305) supsc (-2) endsc } bind def
/inAngrr { showif (\() Angrr (\)) showif } bind def
/wmin {grec (w) endgr () subsc (min) endsc} def
/winpi { grec (w) endgr ( / 2) grec (p) endgr } def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Coordinate Frame %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Layout presets:
/xyTicLen {0.10 fm} def
/xyTacLen {0.20 fm} def
/txllen {0.20 fm} def
/tyllen {0.20 fm} def
/linsetAxx {black 0.7 setline} def
/linsetTic {black 0.7 setline} def
/linsetTac {black 0.7 setline} def
/linsetGri {black 0.4 setline} def
%% Start-up commands:
/Resets {
/yNumLengthL 0 def /yNumLengthH 0 def
/xNumHeightL .3 def /xNumHeightH 0 def
/xNumHeightRel 2.4 def
/aMean 5 def
black
} def
/BoxBackground {
0 10 0 10 rect gsave setboxbackgroundcolor fill grestore
} def
/setboxbackgroundcolor { white } def
/zValues { pop pop } def
/whiteframe { 1 0 0 10 10 graybox } def
/abc {abclab setown abcx abcy 3 2 roll textCM} def % usage ((a)) abc
/abcset { % x y siz abcset - : preset for abc
/abclab x def /abcy x def /abcx x def
} def
%% Ticks:
% set tick array - internal macros
/tiputs { % rel_pos_of_tick | pos_of_tick : innermost routine for /taproc
tastep mul taloop add
} def
/taproclin { % (#tick/tack) | - : define /taproc for use in SetVec
1 x div /tistep x def
/taproc { 0 tistep .999 { tiputs } for } def
} def
/taproclog { % (#ticks/tacks) | - : define /taproc for use in SetVec
dup 3 gt { pop /taproc { 1 1 9 { log tiputs } for } def
}{ dup 1 gt { pop /taproc { 0 tiputs 2 log tiputs 5 log tiputs } def
}{ dup 0 gt { pop /taproc { 0 tiputs } def
}{ neg taproclin
} ifelse } ifelse } ifelse
} def
/SetVec { % tafro tatoo nta /vector | - : set /vector
4 1 roll
/nta x def /tatoo x def /tafro x def
/tastep tatoo tafro sub nta 1 sub div def
[
0 1 nta {
tastep mul tafro add /taloop x def
taproc exec
} for
] def
} def
% set tick array - user commands
/SetTicVecLin { taproclin /TicVec SetVec } def
/SetTicVecLog { taproclog /TicVec SetVec } def
% set tack-and-number array
/SetTacVec { % [ pos {label} pos {label} ... ] | -
/TacVec x def
} def
% define axes
% note on angles : 0 = x-axis, 90 = y-axis
/OneAxx { % fro to xpos ypos aang tang | - : presets for Axx, Tic, Tac, Num
% store arguments
/tAng x def /aAng x def
/yPos x def /xPos x def
/aTo x def /aFro x def
% set constants
/xTicLen tAng cos xyTicLen mul def /yTicLen tAng sin xyTicLen mul def
/xTacLen tAng cos xyTacLen mul def /yTacLen tAng sin xyTacLen mul def
/xAng aAng cos def /yAng aAng sin def
/aMean aFro aTo add 2 div def
} def
% draw axis (with parameters preset by OneAxx or ArrAxx)
/Axx { % - | -
linsetAxx
gsave
xPos yPos offset
mmscale
aAng rotate
% draw a line
aFro 0 np mv
aTo 0 li st
grestore
} def
% draw ticks (positions given by SetTicVec, parameters preset by OneAxx/..)
/Tic { % - | - : draw tick as defined in TicProc
linsetTic
TicVec {
dup dup aFro lt x aTo gt or {pop} {TicProc} ifelse
} forall
} def
/TicProc { % aPos | - : default procedure to plot one tick
np
xPos yPos xym mv
dup xAng mul x yAng mul xym rm % eat argument, go to start pos.
xTicLen yTicLen rl st
} def
/xGric { % yFro yTo | - : draw a grid line (instead of an x tick)
linsetGri
TicVec {
3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
dup % y1 y2 x x
4 -1 roll xym np mv % y2 x
x xym li st
} ifelse
} forall
pop pop
} def
/yGric { % xFro xTo | - : draw a grid line (instead of an y tick)
linsetGri
TicVec {
3 copy dup 5 -1 roll aFro lt x aTo gt or {pop pop pop} {
dup % x1 x2 y y
4 -1 roll x xym np mv % x2 y
xym li st
} ifelse
} forall
pop pop
} def
% draw tacks (positions given by SetTacVec, parameters preset by OneAxx/..)
/TacExe { % Proc | - % Execute Proc for all pairs of elements of TacVec
% (but only if inside aFro..aTo)
/TacProc x def
/ispair true def % toggle: take pos, take label, take pos, take label ...
TacVec {
ispair
{
/aPos x def
/ispair false def
} {
aPos dup aFro lt x aTo gt or
{pop} {TacProc} ifelse
/ispair true def
} ifelse
} forall
} def
/Tac {
linsetTac
{ pop xPos yPos xym mv
aPos dup xAng mul x yAng mul xym rm
xTacLen yTacLen rl st
} TacExe
} def
% special tack routines, only for rectangular axes
/xTacC { % : centered tack on x axis
linsetTac
{ pop aPos xm yPos ym txllen 2 div sub np mv 0 txllen rl st } TacExe
} def
/xGrid { % : rule instead of tack on x axis
linsetTac
{ pop aPos xm np yPos ym mv 0 10 xym rl st } TacExe
} def
/yTacC { % : centered tack on y axis
linsetTac
{ pop xPos xm tyllen 2 div sub aPos ym np mv tyllen 0 rl st } TacExe
} def
/yGrid { % : rule instead of tack on low y axis
linsetTac
{ pop aPos ym np xPos xm x mv 10 0 xym rl st } TacExe
} def
% draw numbers (pos-txt pairs given by SetTacVec)
/Num { % Generic but useless. Adjust for your application.
setnum
fontheight ymm div yDisRel mul tAng sin mul /yDist x def
{ dup textW xDisRel mul tAng cos mul /xDist x def
xPos aPos xAng mul add xDist sub
yPos aPos yAng mul add yDist sub 3 2 roll textCM
} TacExe
} def
/setnumDisRel { % xDisRel yDisRel | - : adjust just a little bit
/yDisRel x def /xDisRel x def
} def
1.2 1.2 setnumDisRel % default setting
% explicit Num routines for rectangular case
/xNumL { % : numbers on low x axis
setnum
{ fontheight ymm div % conversion -> user_scale
dup /xNumHeightL x def
-.6 mul yPos add aPos x 3 2 roll textCT
} TacExe
} def
/xNumH { % : numbers on high x axis
setnum
{ fontheight ymm div % conversion -> user_scale
dup /xNumHeightH x def
.6 mul yPos add aPos x 3 2 roll textCB
} TacExe
} def
/yNumL { % : numbers on low y axis
setnum
{ fontsize -.3 mul xmm div xPos add aPos 3 2 roll textRM
xwidth dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
} TacExe
} def
/yNumLD { % : calculate only yNumLength (used for adjustement)
setnum
{ textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
} TacExe
} def
/yDumL { % {(..)} yDumL : compare yNumLength with one arg (used for adjustement)
setnum
textW dup yNumLengthL gt {/yNumLengthL x def} {pop} ifelse
} def
/yNumH { % : numbers on high y axis
setnum
{ fontsize .3 mul xmm div xPos add aPos 3 2 roll textLM
xwidth dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
} TacExe
} def
/yNumHD { % : calculate only yNumLength (used for adjustement)
setnum
{textW dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
} TacExe
} def
/yDumH { % {(..)} yDumH : compare yNumLength with one arg (used for adjustement)
setnum
textW dup yNumLengthH gt {/yNumLengthH x def} {pop} ifelse
} def
% draw labels
/xCL { % xlabel | - ; plots coordinate name below the x-axis.
setlab
aMean xNumHeightL xNumHeightRel neg mul
3 -1 roll textCT
} def
/xCH { % xlabel | - ; plots coordinate name above the x-axis.
setlab
aMean xNumHeightH xNumHeightRel mul 10 add
3 -1 roll textCB
} def
/yCL { % ylabel | - ; plots coordinate name to the left of the y-axis.
gsave
setlab
yNumLengthL neg fontsize -.85 mul add % yNumLengthL calculated in yN
aMean ym translate
0 0 mv