[NTG-context] m-graph label

John Kitzmiller jkitzm at gmail.com
Sat Jul 30 23:04:03 CEST 2022


On Tue, Jul 26, 2022 at 1:51 PM Alan <braslau.list at comcast.net> wrote:

> On Thu, 21 Jul 2022 17:56:45 -0400
> John Kitzmiller <jkitzm at gmail.com> wrote:
>
> > > On Wed, Jul 20, 2022 at 9:48 AM Alan <braslau.list at comcast.net>
> > > wrote: % Autoform                       is the format string used
> > > by autogrid % Autoform_X, Autoform_Y         if defined, are used
> > > instead
> > >
> > > string Autoform ; Autoform = "%g";
> > >
> > > % string Autoform_X ; Autoform_X := "@.0e" ;
> > > % string Autoform_Y ; Autoform_Y := "@.0e" ;
> >
> >
> > Thanks Alan. I see those lines in the module listing, but could you
> > provide some guidance on usage? Can the (re)formatting be done from
> > my input file, or do I need to modify mp-grap.mpiv, or some other way?
> >
> > (Apologies for double-dipping, but usage direction for the
> > least-squares fit extension in m-graph would be a gift.)
>
> You can set these strings in your source file, no need to have a
> private copy of mp-grap.mpiv
>
> Autoform := "@.0e" ;
>
> or, if you want different formats for the X and Y axes:
>
> string Autoform_X ; Autoform_X := "@.0e" ; % or whatever you want ...
> string Autoform_Y ; Autoform_Y := "@.0e" ;
>
> A few notes:
>
> Autoform_X and Autoform_Y are used if known, otherwise it falls back
> on the string Autoform.
>
> The format string uses "@" rather then "%", as % is normally scanned as
> a comment.
>

Thank you again, but the "0.0" remains unchanged. The only way I've been
able to succeed is with a for loop to label explicitly. See mwe below for
things I've attempted. The last two for lines seems to be what it takes
(with the other Auto lines commented out of course.)

% 0 0
% 1 1
% 2 3
% 3 5

\enabletrackers[metapost.showlog]
\usemodule[m-graph]

\startMPpage[instance=graph, offset=5mm]
  draw begingraph(160, 100);
    gdraw "mwe-2.tex" plot circles(0);

    Autoform := "@0.g" ;
    autogrid(otick.bot,otick.lft);

    % for x=auto.x: otick.bot(format("@g",x),x); endfor;
    % for y=auto.y: otick.lft(format("@g",y),y); endfor;

    % for x = 0 upto 3: otick.bot(x,x); endfor;
    % for y = 0 upto 5: otick.lft(y,y); endfor;
  endgraph;
\stopMPpage
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20220730/b951e766/attachment.htm>


More information about the ntg-context mailing list