[metapost] Missing warningcheck:=0 in graph.mp?

Ian D. Leroux idleroux at fastmail.fm
Sat Sep 1 21:42:40 CEST 2012


I am a regular user of the graph.mp facilities.  I occasionally have to
prepare graphs where the range is very much smaller or larger than 1. In
those cases the graph-drawing routines often fail with "Value is too
large" errors which look like they come from using marith.mp's floating-
point macros without setting warningcheck:=0 as required.  Here's a
test case:

input graph
beginfig(1)
  draw begingraph(8cm, 6cm);
    interim warningcheck := 0;
    setcoords(log, log);
    setrange(1, "1e-10", 100, 1);
  endgraph;
endfig;
end;

Running this in Metapost 1.504 (MikTeX 2.9) succeeds, but if you remove
the additional warningcheck:=0 instruction it fails with

! Value is too large (-4715.69434).
Glab_->...h(EXPR2);else:save.x,y;z=llcorner.Gcbb_;
                                                  if.unknown.xpart(EXPR2):xp...
Glab_->...nown.ypart(EXPR0):1+fi0);Gupbb_((EXPR0))
                                                  ;addto.Gcur_.also.image((T...
endgraph->...FFIX1),false,(EXPR3),(EXPR4),(TEXT5))
                                                  ;endgroup
<to be read again> 
                   ;
<for("1e-6")> otick.lft(Autoform,(EXPR0));
                                           ENDFOR
endgraph->...y:(SUFFIX3)(Autoform,y)(TEXT4);endfor
                                                  .fi.endgroup
<to be read again> 
                   ;
endgraph->...eedgr_:autogrid(otick.bot,otick.lft);
                                                  fi.if.Gneedfr_:frame;fi.se...
l.8   endgraph
              ;
? 

Where is the correct place in graph.mp to disable warnings during the
autotick calculations?

Please CC me in replies, as I am not subscribed to the list.

Regards,

-- IDL


More information about the metapost mailing list