home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 28.ddi / reloc.2 / $POSTSCRIPT / postmd.ps < prev    next >
Encoding:
Text File  |  1990-12-08  |  3.7 KB  |  175 lines

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