postmd.ps 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. %
  2. % Version 3.3.2 prologue for matrix display files.
  3. %
  4. /#copies 1 store
  5. /aspectratio 1 def
  6. /font /Helvetica def
  7. /formsperpage 1 def
  8. /landscape false def
  9. /magnification 1 def
  10. /margin 10 def
  11. /orientation 0 def
  12. /rotation 1 def
  13. /size 9 def
  14. /statspace 1.6 def
  15. /ticklength .06 def
  16. /tickspacing 10 def
  17. /xoffset 0 def
  18. /yoffset 0 def
  19. /useclippath true def
  20. /pagebbox [0 0 612 792] def
  21. /inch {72 mul} bind def
  22. /min {2 copy gt {exch} if pop} bind def
  23. /show {show} bind def % so later references don't bind
  24. /stringwidth {stringwidth} bind def
  25. /setup {
  26. counttomark 2 idiv {def} repeat pop
  27. landscape {/orientation 90 orientation add def} if
  28. pagedimensions
  29. height width lt {
  30. /statspace statspace height width div mul def
  31. /size size height width div mul def
  32. /ticklength ticklength height width div mul def
  33. } if
  34. /height height margin sub statspace inch sub ticklength inch sub size 6 mul sub def
  35. /width width margin sub ticklength inch sub def
  36. xcenter ycenter translate
  37. orientation rotation mul rotate
  38. xoffset inch yoffset inch translate
  39. 0 height 2 div height width min 2 div sub translate
  40. 0 statspace inch 2 div translate
  41. magnification dup aspectratio mul scale
  42. 0 setlinewidth
  43. } def
  44. /pagedimensions {
  45. useclippath {
  46. /pagebbox [clippath pathbbox newpath] def
  47. } if
  48. pagebbox aload pop
  49. 4 -1 roll exch 4 1 roll 4 copy
  50. landscape {4 2 roll} if
  51. sub /width exch def
  52. sub /height exch def
  53. add 2 div /xcenter exch def
  54. add 2 div /ycenter exch def
  55. userdict /gotpagebbox true put
  56. } def
  57. /pagesetup {/page exch def} bind def
  58. /bitmap {
  59. /scanlines exch def
  60. /scanlength exch def
  61. /picstr scanlength string def
  62. gsave
  63. height scanlines div width scanlength div min
  64. /scaling exch def
  65. scaling scaling scale
  66. scanlength neg 2 div scanlines neg 2 div translate
  67. scanlength scanlines scale
  68. getbitmap
  69. grestore
  70. } bind def
  71. /getbitmap {
  72. scanlength scanlines 8 [scanlength 0 0 scanlines neg 0 scanlines] {
  73. 0 {
  74. currentfile token pop dup
  75. 0 eq {pop pop exit} if
  76. /charcount exch def
  77. picstr 1 index charcount getinterval
  78. /repl exch def
  79. currentfile repl readhexstring pop pop
  80. charcount add
  81. currentfile token pop {
  82. picstr 1 index repl putinterval
  83. charcount add
  84. } repeat
  85. } loop
  86. picstr
  87. } image
  88. } bind def
  89. /labelmatrix {
  90. /matrixlimits exch def
  91. /matrixname exch def
  92. gsave
  93. scaling scaling scale
  94. font findfont size scaling div scalefont setfont
  95. scanlength neg 2 div scanlines 2 div translate
  96. 0 scanlines size 1.5 mul scaling div add neg moveto
  97. matrixname show
  98. scanlength scanlines size 1.5 mul scaling div add neg moveto
  99. matrixlimits stringwidth pop neg 0 rmoveto
  100. matrixlimits show
  101. newpath
  102. 0 0 moveto
  103. scanlength 0 rlineto
  104. 0 scanlines neg rlineto
  105. scanlength neg 0 rlineto
  106. closepath stroke
  107. scanlength tickspacing idiv 1 add tickspacing 0 ticks
  108. scanlines tickspacing idiv 1 add 0 tickspacing neg ticks
  109. grestore
  110. } bind def
  111. /ticks {
  112. /dy exch def
  113. /dx exch def
  114. /tl ticklength inch scaling div def
  115. newpath
  116. 0 0 moveto
  117. {
  118. gsave dx 0 eq {tl neg 0} {0 tl} ifelse rlineto stroke grestore
  119. dx dy rmoveto
  120. } repeat
  121. } bind def
  122. /legend {
  123. /regions exch def
  124. /total exch def
  125. gsave
  126. width height min 2 div neg dup size 2 mul sub translate
  127. 0 statspace inch neg translate
  128. gsave
  129. regions {
  130. gsave
  131. total div statspace inch size 2 mul sub mul size 2 mul add
  132. width height min regions div exch scale
  133. 1 1 8 [1 0 0 1 0 0] 5 -1 roll image
  134. grestore
  135. width height min regions div 0 translate
  136. } repeat
  137. grestore
  138. width height min size 1.5 mul neg translate
  139. font findfont size scalefont setfont
  140. dup dup add 1 add width height min exch div /interval exch def
  141. {
  142. interval neg 0 translate
  143. interval 2 div neg 0 translate
  144. dup stringwidth pop 2 div neg 0 moveto show
  145. interval 2 div neg 0 translate
  146. } repeat
  147. grestore
  148. } bind def
  149. /done {/lastpage where {pop lastpage} if} def