
%%%
%%%  File: mfpic.tex
%%%

% preliminary version of macros
\newwrite\outx\newbox\labeledgraph\newbox\temp
\newdimen\labeltemp\newcount\code
\def\opengraphsfile#1{\code32\openout\outx=#1.mf\font\graph=#1
\immediate\write16{Don't forget to process #1.mf!}
\immediate\write16{Then reprocess this file.}
\write\outx{mag:=\number\mag/1000; input graphbase.mf; code:=32;}}
\def\closegraphsfile{\write\outx{end.}\closeout\outx}
\def\picture#1#2#3#4#5{%
\advance\code1\bgroup\setbox\labeledgraph=\vtop{\graph \char\code}
\write\outx{scale:=#1; bounds(#2,#3,#4,#5);}
\write\outx{beginchar(incr
code,scale*(xpos-xneg)*pt\#,scale*(ypos-yneg)*pt\#,0);}
\write\outx{pickup pencircle scaled 0.5pt;}
\def\pen##1{\write\outx{pickup pencircle scaled ##1pt;}}
\def\axes{\write\outx{axes(10);}}
\def\xmarks##1{\write\outx{xmarks(10,##1);}}
\def\ymarks##1{\write\outx{ymarks(10,##1);}}
\def\curve##1{\write\outx{curve(##1);}}
\def\point##1{\write\outx{point(##1,3);}}
\def\line##1{\write\outx{line(##1);}}
\def\arrow##1{\write\outx{arrow(##1,6);}}
\def\circle##1{\write\outx{circle(##1);}}
\def\ellipse##1{\write\outx{ellipse(##1,0);}}
\def\rotatedellipse##1{\write\outx{ellipse(##1);}}
\def\xconv##1{\global\advance##1 by -#2pt\global\multiply##1 by #1
\global\advance##1 by 20pt} % -- horizontal fudge factor
\def\yconv##1{\global\advance##1 by -#4pt\global\multiply##1 by -#1
\global\advance##1 by 0pt} % -- vertical fudge factor
\def\label##1##2##3{\setbox\labeledgraph=\vtop{\unvbox\labeledgraph%
\vbox to0pt{\setbox\temp=\vbox{##3}\kern-\ht\temp%
\labeltemp=##2pt\yconv\labeltemp\kern\labeltemp%
\hbox{\labeltemp=##1pt\xconv\labeltemp%
\kern\labeltemp{##3}}\vss}\nointerlineskip}\hfill} % -- end \label
\def\docaption{}
\def\caption##1{\def\docaption{\par\hskip0.25in##1}}
} % -- end \picture
\def\endpicture{\write\outx{endchar;}\par\hbox{\hskip0.25in\box\labeledgraph}
\docaption\par\noindent\egroup} % -- end \endpicture
