\input diagram.def
%
\def\xaxIs{\ifnum\xscaling=1\raise\xnumberheight\hbox to\xtotal{%
\kern\xpos\kern-.5\xnumberlength\loop\xvalint\xmin%
\divide\xvalint\xbasis\xvalfrac\xvalint%
\multiply\xvalfrac-\xbasis\advance\xvalfrac\xmin%
\relax\ifnum\xvalfrac<0\xvalfrac-\xvalfrac\fi%
\ifnum\xvalint<0\xvalint-\xvalint\fi%
\hbox to\xnumberlength{\setbox0\hbox{\the\xvalfrac}%
\loop\ifdim\wd0<\xfraclen\setbox0\hbox{0\unhbox0}\repeat%
\hss\ifnum\xmin<0-\fi\number\xvalint,\box0}%
\ifnum\xmin<\xmax\advance\xmin\xinc\hss%
\else\xfinal1\fi\relax\ifnum\xfinal<1\repeat%
}\kern-\xtotal\fi}%
%
\def\yaxIs{\ifnum\yscaling=1\raise\ynumbering%
\hbox to\xpos{\advance\ylength\ht2%
\vbox to\ylength{\xfinal0\yfinal0\loop%
\advance\xfinal1\xvalint\ymin%
\divide\xvalint\ybasis\yvalfrac\xvalint%
\multiply\yvalfrac-\ybasis\advance\yvalfrac\ymin%
\relax\ifnum\yvalfrac<0\yvalfrac-\yvalfrac\fi%
\ifnum\xvalint<0\xvalint-\xvalint\fi%
\setbox\xfinal\hbox to\xpos{\setbox0\hbox{\the\yvalfrac}%
\loop\ifdim\wd0<\yfraclen\setbox0\hbox{0\unhbox0}\repeat%
\hfill\ifnum\ymin<0-\fi\number\xvalint,\box0\kern.5\em}%
\advance\ymin\yinc\relax\ifnum\ymin>\ymax\yfinal1\fi\relax%
\ifnum\yfinal=0\repeat%
\loop\box\xfinal\negadvAnce\xfinal1\relax%
\ifnum\xfinal>0\vss\repeat}%
}\kern-\xpos\fi}%
