From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/115595 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John Kitzmiller via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: m-graph label Date: Sat, 30 Jul 2022 17:04:03 -0400 Message-ID: References: <20220720074829.691a4c13@boo.my.domain> <20220726115110.5c09c7bd@boo.my.domain> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1022767553007921253==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1856"; mail-complaints-to="usenet@ciao.gmane.io" Cc: John Kitzmiller , John Kitzmiller via ntg-context To: Alan Original-X-From: ntg-context-bounces@ntg.nl Sat Jul 30 23:05:22 2022 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oHteE-0000Ey-74 for gctc-ntg-context-518@m.gmane-mx.org; Sat, 30 Jul 2022 23:05:22 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1FC6528A63F; Sat, 30 Jul 2022 23:04:48 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Iz1T3piZo4Vt; Sat, 30 Jul 2022 23:04:46 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4EA8E28A62E; Sat, 30 Jul 2022 23:04:46 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4B94028A613 for ; Sat, 30 Jul 2022 23:04:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id unlix4XGpNKR for ; Sat, 30 Jul 2022 23:04:44 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.222.52; helo=mail-ua1-f52.google.com; envelope-from=jkitzm@gmail.com; receiver= Original-Received: from mail-ua1-f52.google.com (mail-ua1-f52.google.com [209.85.222.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 38345289E4D for ; Sat, 30 Jul 2022 23:04:44 +0200 (CEST) Original-Received: by mail-ua1-f52.google.com with SMTP id f10so3132745uap.2 for ; Sat, 30 Jul 2022 14:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I7NYUyqxsrSMwrI7n3eHgf0RfWjErXD4zVxd/RJRkd8=; b=L/edoR+hs6B4gsCFCQtLV5zKjvSVunubLRWmBv6OVLRYYqMSKI7PRgYuWDw6WMcvKY DiXBm5KJcNaeBk2LtE6tCy37MaLJZpPFt///0+4VeW216RgslFSCtARLnobOZ/GEcWRd YBIqmSyNjfjo5AtoB4jQqhlxcJyQngdjy6xf0pPa6s3kCTbZQsECnuLuFCRZeKuOmRGj 2kGJyDK0q3U7nIAqphIh8r9ugVo/njyWXzUuG/G38c2TIUCmQHgE2xoHQc6IJUT29qdl /T65wFdVpqO0jFovediXzsrdEUf8XnFdOTavHLn37CDZ6J9el0uauiFPrL9NAf/mgeJb 0/Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=I7NYUyqxsrSMwrI7n3eHgf0RfWjErXD4zVxd/RJRkd8=; b=tGK8iSt6xggVwk29WpZ/GxMTYG8VYUJtf88VJngCvqMeNbiRzDi7QpsE9u6H9TEzkL TOh2O2CxPrWVkMJ5O2nRe91yrMmAN0CwvMG97EEd0piRunlqAU0hqU8QvRH1YRVPyRKo stXcak2C/FBHZY9VVllil+K8YAtG1izzzGPYj+MxJLARL8sTsyceSSqh8j0uP4XCiP/c YSecl4jMRUsQmJoCPv61Y1W7AIPOKDthtf9zCdIK3ZNo3QIWpUdL0kixYbEXxqV08XOq cUlniExrcDwGEioEkLOx25/9+I8kBTquJZwSyk8TawrSF3dv2/wnQCZWY6Q6PNJF2Mo1 2paA== X-Gm-Message-State: ACgBeo16miXHeArLKWkAXUThdHdgxNJIF/tnRuO/h1LpLTTGArLZuP2G xrJaO5P+aeh2NApdebruqkL+rIAo2nHiP0qEKzY= X-Google-Smtp-Source: AA6agR4620Tz33pGfhC2y56IlMP8YO9OLg9BISFDEJRw2GDYmcNVf26CbCgM81O+faU93yYcCfJHZDwHW7vZyZ8Tul8= X-Received: by 2002:a9f:29c5:0:b0:384:be1e:fa65 with SMTP id s63-20020a9f29c5000000b00384be1efa65mr3661017uas.115.1659215079355; Sat, 30 Jul 2022 14:04:39 -0700 (PDT) In-Reply-To: <20220726115110.5c09c7bd@boo.my.domain> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:115595 Archived-At: --===============1022767553007921253== Content-Type: multipart/alternative; boundary="000000000000693a1005e50c1dbb" --000000000000693a1005e50c1dbb Content-Type: text/plain; charset="UTF-8" On Tue, Jul 26, 2022 at 1:51 PM Alan wrote: > On Thu, 21 Jul 2022 17:56:45 -0400 > John Kitzmiller wrote: > > > > On Wed, Jul 20, 2022 at 9:48 AM Alan > > > 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 --000000000000693a1005e50c1dbb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Jul 26, 2022 at 1:51 PM Alan <<= a href=3D"mailto:braslau.list@comcast.net">braslau.list@comcast.net>= wrote:
On Thu, 21 Jul 2022 17:56:45 -0400
John Kitzmiller <j= kitzm@gmail.com> wrote:

> > On Wed, Jul 20, 2022 at 9:48 AM Alan <braslau.list@comcast.net>
> > wrote: % Autoform=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is the format string used
> > by autogrid % Autoform_X, Autoform_Y=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0if defined, are used
> > instead
> >
> > string Autoform ; Autoform =3D "%g";
> >
> > % string Autoform_X ; Autoform_X :=3D "@.0e" ;
> > % string Autoform_Y ; Autoform_Y :=3D "@.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 :=3D "@.0e" ;

or, if you want different formats for the X and Y axes:

string Autoform_X ; Autoform_X :=3D "@.0e" ; % or whatever you wa= nt ...
string Autoform_Y ; Autoform_Y :=3D "@.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 nor= mally scanned as
a comment.

Thank you agai= n, but the "0.0" remains unchanged. The only way I've been ab= le to succeed is with a for loop to label explicitly. See=C2=A0mwe=C2=A0bel= ow for things I've attempted. The last two for lines seems to be what i= t 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=3Dgr= aph, offset=3D5mm]
=C2=A0 draw begingraph(160, 100);
=C2=A0 =C2=A0 gd= raw "mwe-2.tex" plot circles(0);
=C2=A0 =C2=A0
=C2=A0 =C2= =A0 Autoform :=3D "@0.g" ;
=C2=A0 =C2=A0 autogrid(otick.bot,ot= ick.lft);
=C2=A0 =C2=A0
=C2=A0 =C2=A0 % for x=3Dauto.x: otick.bot(fo= rmat("@g",x),x); endfor;
=C2=A0 =C2=A0 % for y=3Dauto.y: otick= .lft(format("@g",y),y); endfor;
=C2=A0
=C2=A0 =C2=A0 % for= x =3D 0 upto 3: otick.bot(x,x); endfor;
=C2=A0 =C2=A0 % for y =3D 0 upt= o 5: otick.lft(y,y); endfor;
=C2=A0 endgraph;
\stopMPpage
--000000000000693a1005e50c1dbb-- --===============1022767553007921253== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cHM6Ly93d3cubnRnLm5sL21haWxtYW4v bGlzdGluZm8vbnRnLWNvbnRleHQKd2VicGFnZSAgOiBodHRwczovL3d3dy5wcmFnbWEtYWRlLm5s IC8gaHR0cDovL2NvbnRleHQuYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHBzOi8vYml0YnVja2V0 Lm9yZy9waGcvY29udGV4dC1taXJyb3IvY29tbWl0cy8Kd2lraSAgICAgOiBodHRwczovL2NvbnRl eHRnYXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============1022767553007921253==--