[tex-live] [metafont] MetaPost bug fix in the graph.mp macros

John Hobby hobby@research.bell-labs.com
Thu, 14 Nov 2002 09:39:11 -0500 (EST)


I have fixed a bug the setrange command whereby nonzero lower bounds
and upper bounds greater than about 10000 caused the lower bounds to
get messed up.  For example, a command like this can often cause the problem:
  setrange(110,110,"22000","22000");

I have updated the master copy of graph.mp in
    http://netlib.bell-labs.com/netlib/research/metapost.tar.Z
and this should show up automatically in CTAN and various other places
as metapost.tar.gz (or something like that).
Since this is just a change in the macros, it does not really count as a new
version of MetaPost.

I do *not* recommend that casual users go to these master distributions.
They are hard to install and serve mainly as a place for maintainers of
TeX/LaTeX/METAFONT/MetaPost distrubtions to get their raw material.
If you want to try it right away, just give the following macro
redefinition after   input graph

- John Hobby
%---------------------------------------------------%

% @# is X_ or Y_; $ is Gxcvlin_ or Gycvlin_; l and h are numeric or string
% It would not be OK to set (@#low,@#high) to a pair expression because $ might
% try to rescale @#low when evaluating the right-hand side for @#high.
vardef Gsetr_@#(suffix $)(expr l, h) =
  Gclbnds_@#;
  if @#ctyp>0:
    @#low = if abs @#ctyp<>log: $ fi Mlog_Str l;
    @#high = if abs @#ctyp<>log: $ fi Mlog_Str h;
  else:
    -@#high = if abs @#ctyp<>log: $ fi Mlog_Str l;
    -@#low = if abs @#ctyp<>log: $ fi Mlog_Str h;
  fi
enddef;