[metapost] setrange inconsistency

Troy Henderson thenders at gmail.com
Tue Oct 30 21:52:11 CET 2007


The following two code snippets give quite different results, and it
would seem that they should be basically the same:

%%% begin snipet 1 %%%
input graph;
draw begingraph(3in,2in);
setrange("0","-4e3","1","4e3");
endgraph;
%%% end snippet 1 %%%

%%% begin snipet 2 %%%
input graph;
draw begingraph(3in,2in);
setrange("0","-4e4","1","4e4");
endgraph;
%%% end snippet 2 %%%

Now I understand that once numbers get above ~32000 or so, then clever
tricks have to be played to keep computations from overflowing
MetaPost, but what's the point of using strings in setrange() if this
is an issue?

My goal is to be able to get MetaPost to provide me with the auto tick
placements auto.x and auto.y with "large numbers".  Once I have these
in strings, I can use sarith to manipulate them.

Ideas?

Thanks

Troy Henderson


More information about the metapost mailing list