annotate glib/axes.h @ 0:5242703e91d3 tip

Initial checkin for AIM92 aimR8.2 (last updated May 1997).
author tomwalters
date Fri, 20 May 2011 15:19:45 +0100
parents
children
rev   line source
tomwalters@0 1 static char *axes_postscript[] = {
tomwalters@0 2 "%! simple postscript axes",
tomwalters@0 3 "% @(#)axes.h 1.10 John holdsworth 5/31/91",
tomwalters@0 4 "",
tomwalters@0 5 "/Axes { % title xmin xmax xtitle ymin ymax ytitle Axes -",
tomwalters@0 6 "/AxesDict 50 dict def",
tomwalters@0 7 "AxesDict begin",
tomwalters@0 8 "",
tomwalters@0 9 " /ytitle exch def",
tomwalters@0 10 " /ymax exch def",
tomwalters@0 11 " /ymin exch def",
tomwalters@0 12 " /xtitle exch def",
tomwalters@0 13 " /xmax exch def",
tomwalters@0 14 " /xmin exch def",
tomwalters@0 15 " /title exch def",
tomwalters@0 16 "",
tomwalters@0 17 " newpath clippath pathbbox /height exch def",
tomwalters@0 18 " /width exch def",
tomwalters@0 19 " pop pop",
tomwalters@0 20 "",
tomwalters@0 21 " /tagsize 0.05 height mul neg def",
tomwalters@0 22 " /fontsize 0.05 height mul def",
tomwalters@0 23 " /space 0.10 height mul def",
tomwalters@0 24 "",
tomwalters@0 25 " /Times-Roman findfont fontsize scalefont setfont",
tomwalters@0 26 "",
tomwalters@0 27 " /midprint { % str x y midprint -",
tomwalters@0 28 " moveto",
tomwalters@0 29 " dup",
tomwalters@0 30 " stringwidth pop 2 div neg 0 rmoveto",
tomwalters@0 31 " show",
tomwalters@0 32 " } def",
tomwalters@0 33 "",
tomwalters@0 34 " /leftprint { % str x y leftprint -",
tomwalters@0 35 " moveto",
tomwalters@0 36 " dup",
tomwalters@0 37 " stringwidth pop neg fontsize 0.4 mul neg rmoveto",
tomwalters@0 38 " show",
tomwalters@0 39 " } def",
tomwalters@0 40 "",
tomwalters@0 41 " /ticks { % min max ticker -",
tomwalters@0 42 " /ticker exch def % procedure to draw ticks",
tomwalters@0 43 " /max exch cvr def % axis maximum",
tomwalters@0 44 " /min exch cvr def % axis minimum",
tomwalters@0 45 "",
tomwalters@0 46 " /maxsubticks 50 def",
tomwalters@0 47 "",
tomwalters@0 48 " max min ne {",
tomwalters@0 49 "",
tomwalters@0 50 " % calculate order of magnitude",
tomwalters@0 51 "",
tomwalters@0 52 " /delta max min sub log ceiling 1 sub 10 exch exp def",
tomwalters@0 53 "",
tomwalters@0 54 " % do ticks",
tomwalters@0 55 "",
tomwalters@0 56 " min delta div ceiling delta mul",
tomwalters@0 57 " delta",
tomwalters@0 58 " max delta div floor delta mul",
tomwalters@0 59 " {",
tomwalters@0 60 " min sub max min sub div 0.5 exch ticker",
tomwalters@0 61 " }",
tomwalters@0 62 " for",
tomwalters@0 63 "",
tomwalters@0 64 " % do sub ticks",
tomwalters@0 65 "",
tomwalters@0 66 " max min sub delta div dup",
tomwalters@0 67 " 10 mul maxsubticks lt {.1} {5 mul maxsubticks lt {.2} {.5} ifelse } ifelse",
tomwalters@0 68 " delta mul /delta exch def",
tomwalters@0 69 "",
tomwalters@0 70 " min delta div ceiling delta mul",
tomwalters@0 71 " delta",
tomwalters@0 72 " max delta div floor delta mul",
tomwalters@0 73 " {",
tomwalters@0 74 " min sub max min sub div 0.25 exch ticker",
tomwalters@0 75 " }",
tomwalters@0 76 " for",
tomwalters@0 77 "",
tomwalters@0 78 " } if",
tomwalters@0 79 "",
tomwalters@0 80 " } def",
tomwalters@0 81 "",
tomwalters@0 82 " width 0.20 mul 0.15 height mul translate 0.75 0.75 scale",
tomwalters@0 83 "",
tomwalters@0 84 " gsave",
tomwalters@0 85 "",
tomwalters@0 86 " height 0.002 mul setlinewidth",
tomwalters@0 87 " currentlinewidth 2 div neg dup translate",
tomwalters@0 88 "",
tomwalters@0 89 " newpath",
tomwalters@0 90 " tagsize 0 moveto width 0 lineto width tagsize lineto",
tomwalters@0 91 " tagsize height moveto 0 height lineto 0 tagsize lineto",
tomwalters@0 92 " stroke",
tomwalters@0 93 "",
tomwalters@0 94 "",
tomwalters@0 95 " title width 2 div height tagsize sub midprint",
tomwalters@0 96 "",
tomwalters@0 97 " xmin 0 tagsize fontsize sub midprint",
tomwalters@0 98 " xmax width tagsize fontsize sub midprint",
tomwalters@0 99 "",
tomwalters@0 100 " 0 height moveto width height lineto width 0 lineto stroke",
tomwalters@0 101 "",
tomwalters@0 102 " xmin xmax {width mul 0 moveto tagsize mul 0 exch rlineto stroke} ticks",
tomwalters@0 103 " xmin xmax {width mul height moveto tagsize neg mul 0 exch rlineto stroke} ticks",
tomwalters@0 104 "",
tomwalters@0 105 " xtitle width 2 div tagsize fontsize sub midprint",
tomwalters@0 106 "",
tomwalters@0 107 "",
tomwalters@0 108 " ymin tagsize 0 leftprint",
tomwalters@0 109 " ymax tagsize height leftprint",
tomwalters@0 110 "",
tomwalters@0 111 " ymin ymax {height mul 0 exch moveto tagsize mul 0 rlineto stroke} ticks",
tomwalters@0 112 " ymin ymax {height mul width exch moveto tagsize neg mul 0 rlineto stroke} ticks",
tomwalters@0 113 "",
tomwalters@0 114 " 90 rotate",
tomwalters@0 115 " ytitle height 2 div space midprint",
tomwalters@0 116 "",
tomwalters@0 117 "",
tomwalters@0 118 " grestore",
tomwalters@0 119 "",
tomwalters@0 120 " newpath 0 0 moveto width 0 lineto width height lineto 0 height lineto closepath clip",
tomwalters@0 121 "",
tomwalters@0 122 "end } def",
tomwalters@0 123 ( char * ) 0 } ;