Mercurial > hg > aim92
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/glib/axes.h Fri May 20 15:19:45 2011 +0100 @@ -0,0 +1,123 @@ +static char *axes_postscript[] = { + "%! simple postscript axes", + "% @(#)axes.h 1.10 John holdsworth 5/31/91", + "", + "/Axes { % title xmin xmax xtitle ymin ymax ytitle Axes -", + "/AxesDict 50 dict def", + "AxesDict begin", + "", + " /ytitle exch def", + " /ymax exch def", + " /ymin exch def", + " /xtitle exch def", + " /xmax exch def", + " /xmin exch def", + " /title exch def", + "", + " newpath clippath pathbbox /height exch def", + " /width exch def", + " pop pop", + "", + " /tagsize 0.05 height mul neg def", + " /fontsize 0.05 height mul def", + " /space 0.10 height mul def", + "", + " /Times-Roman findfont fontsize scalefont setfont", + "", + " /midprint { % str x y midprint -", + " moveto", + " dup", + " stringwidth pop 2 div neg 0 rmoveto", + " show", + " } def", + "", + " /leftprint { % str x y leftprint -", + " moveto", + " dup", + " stringwidth pop neg fontsize 0.4 mul neg rmoveto", + " show", + " } def", + "", + " /ticks { % min max ticker -", + " /ticker exch def % procedure to draw ticks", + " /max exch cvr def % axis maximum", + " /min exch cvr def % axis minimum", + "", + " /maxsubticks 50 def", + "", + " max min ne {", + "", + " % calculate order of magnitude", + "", + " /delta max min sub log ceiling 1 sub 10 exch exp def", + "", + " % do ticks", + "", + " min delta div ceiling delta mul", + " delta", + " max delta div floor delta mul", + " {", + " min sub max min sub div 0.5 exch ticker", + " }", + " for", + "", + " % do sub ticks", + "", + " max min sub delta div dup", + " 10 mul maxsubticks lt {.1} {5 mul maxsubticks lt {.2} {.5} ifelse } ifelse", + " delta mul /delta exch def", + "", + " min delta div ceiling delta mul", + " delta", + " max delta div floor delta mul", + " {", + " min sub max min sub div 0.25 exch ticker", + " }", + " for", + "", + " } if", + "", + " } def", + "", + " width 0.20 mul 0.15 height mul translate 0.75 0.75 scale", + "", + " gsave", + "", + " height 0.002 mul setlinewidth", + " currentlinewidth 2 div neg dup translate", + "", + " newpath", + " tagsize 0 moveto width 0 lineto width tagsize lineto", + " tagsize height moveto 0 height lineto 0 tagsize lineto", + " stroke", + "", + "", + " title width 2 div height tagsize sub midprint", + "", + " xmin 0 tagsize fontsize sub midprint", + " xmax width tagsize fontsize sub midprint", + "", + " 0 height moveto width height lineto width 0 lineto stroke", + "", + " xmin xmax {width mul 0 moveto tagsize mul 0 exch rlineto stroke} ticks", + " xmin xmax {width mul height moveto tagsize neg mul 0 exch rlineto stroke} ticks", + "", + " xtitle width 2 div tagsize fontsize sub midprint", + "", + "", + " ymin tagsize 0 leftprint", + " ymax tagsize height leftprint", + "", + " ymin ymax {height mul 0 exch moveto tagsize mul 0 rlineto stroke} ticks", + " ymin ymax {height mul width exch moveto tagsize neg mul 0 rlineto stroke} ticks", + "", + " 90 rotate", + " ytitle height 2 div space midprint", + "", + "", + " grestore", + "", + " newpath 0 0 moveto width 0 lineto width height lineto 0 height lineto closepath clip", + "", + "end } def", + ( char * ) 0 } ;