ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: John Kitzmiller via ntg-context <ntg-context@ntg.nl>
To: Alan <braslau.list@comcast.net>
Cc: John Kitzmiller <jkitzm@gmail.com>,
	John Kitzmiller via ntg-context <ntg-context@ntg.nl>
Subject: Re: m-graph label
Date: Sat, 30 Jul 2022 17:04:03 -0400	[thread overview]
Message-ID: <CAHYz2AVJhkvsRm0ojQeVVqrQQO0T48giWtNhQqhRU4P4OFbjmQ@mail.gmail.com> (raw)
In-Reply-To: <20220726115110.5c09c7bd@boo.my.domain>


[-- Attachment #1.1: Type: text/plain, Size: 2164 bytes --]

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

> On Thu, 21 Jul 2022 17:56:45 -0400
> John Kitzmiller <jkitzm@gmail.com> wrote:
>
> > > On Wed, Jul 20, 2022 at 9:48 AM Alan <braslau.list@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

[-- Attachment #1.2: Type: text/html, Size: 3469 bytes --]

[-- Attachment #2: Type: text/plain, Size: 496 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2022-07-30 21:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-16 17:21 John Kitzmiller via ntg-context
2022-07-20 13:48 ` Alan via ntg-context
2022-07-21 21:56   ` John Kitzmiller via ntg-context
2022-07-26 17:51     ` Alan via ntg-context
2022-07-30 21:04       ` John Kitzmiller via ntg-context [this message]
2022-07-26 18:26     ` Alan via ntg-context
2022-07-30 21:14       ` John Kitzmiller via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHYz2AVJhkvsRm0ojQeVVqrQQO0T48giWtNhQqhRU4P4OFbjmQ@mail.gmail.com \
    --to=ntg-context@ntg.nl \
    --cc=braslau.list@comcast.net \
    --cc=jkitzm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).