From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/90437 Path: news.gmane.org!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Add labels to a grid (Metafun) Date: Fri, 6 Mar 2015 18:15:09 +0100 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0630803952==" X-Trace: ger.gmane.org 1425662163 5381 80.91.229.3 (6 Mar 2015 17:16:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Mar 2015 17:16:03 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Mar 06 18:15:49 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YTvqm-0008U3-S1 for gctc-ntg-context-518@m.gmane.org; Fri, 06 Mar 2015 18:15:48 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1938B1021F for ; Fri, 6 Mar 2015 18:15:48 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id kGo9v7u4Itzx for ; Fri, 6 Mar 2015 18:15:47 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 7022A1022E for ; Fri, 6 Mar 2015 18:15:17 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A8CD5101EA for ; Fri, 6 Mar 2015 18:15:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id TUtc1KatWR3m for ; Fri, 6 Mar 2015 18:15:12 +0100 (CET) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 801C5101E8 for ; Fri, 6 Mar 2015 18:15:12 +0100 (CET) Original-Received: from mail-ig0-x229.google.com (mail-ig0-x229.google.com [IPv6:2607:f8b0:4001:c05::229]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id t26HFAsU026751 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 6 Mar 2015 18:15:11 +0100 Original-Received: by igal13 with SMTP id l13so5125773iga.1 for ; Fri, 06 Mar 2015 09:15:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=/9Jd6bFf1/AC4dn3FNChgf4VUH7mOgmfrhvDAGV+1CA=; b=DEVeab/liPuc1KkC3/mmf0Jgu080U/r/oalyWQDuIw9hb/4lO10RVajgkVHmMmZPDD V/JwDUINL6P64ZwEcXb6fdr5GsVh9ChoGCfjgC6k4bYLNsParrtXLRW2jS1kGg/01oi5 k5e2Jb1fciuBFWVdys59v3al8zSVy3RJHTbEvGZWwaTn2xvsKjLVWDvpW/hOj334/j1W eOG88C/meSF/D7n6XPNCDPfacdGohd+aebQVP0XXNFXBcaX2hxudtxwzgd5bA4bAvJ9F Jrdc0Ed+MNs1SWNtjU2muvDMPjmX1ABbvSu/MGp/LwZdq8rAzaxrJs18TBS96VASG3Wm U76Q== X-Received: by 10.50.107.36 with SMTP id gz4mr29510657igb.25.1425662109951; Fri, 06 Mar 2015 09:15:09 -0800 (PST) Original-Received: by 10.50.239.38 with HTTP; Fri, 6 Mar 2015 09:15:09 -0800 (PST) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2607:f8b0:4001:c05::229; country=US; latitude=38.0000; longitude=-97.0000; http://maps.google.com/maps?q=38.0000,-97.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01O0hfbwk - d92b8225d8f7 - 20150306 (trained as not-spam) Received-SPF: pass (filter4-ams.mf.surf.net: domain of fabrice1.couvreur@gmail.com designates 2607:f8b0:4001:c05::229 as permitted sender) receiver=filter4-ams.mf.surf.net; client-ip=2607:f8b0:4001:c05::229; envelope-from=; helo=mail-ig0-x229.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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.org gmane.comp.tex.context:90437 Archived-At: --===============0630803952== Content-Type: multipart/alternative; boundary=047d7b1117bfa252f10510a1d391 --047d7b1117bfa252f10510a1d391 Content-Type: text/plain; charset=UTF-8 To add labels to a grid, Hans wrote a macro hlintext (Min, Max, Step, Lenght , Format). I do not know what to put in "Format". Best regards, Fabrice \definecolor[mycolor][c=.4,m=0,y=0,k=0] \starttext \start \switchtobodyfont[small] \startMPcode input tex; numeric xmin, xmax, ymin, ymax; xmin := 0; xmax := 22; ymax :=460 ;ymin:=0; u := 0.5cm; v:= 0.025cm; drawoptions(withpen pencircle scaled 0.5pt withcolor \MPcolor{mycolor}); draw hlingrid(ymin,ymax,20,11.5cm,11cm); draw vlingrid(xmin,xmax,2,11cm,11.5cm); drawoptions(withpen pencircle scaled 1pt) ; drawarrow (0,0)--(22,0) scaled u ; drawarrow (0,0)--(0,460) scaled v ; for i=0 step 2 until 20 : label.bot(TEX("$"&decimal(i)&"$"),(i,0)*u); endfor; for i=0 step 20 until 440: label.lft(TEX("$"&decimal(i)&"$"),(0,i)*v); endfor; label.bot( "$x$",(10.8cm,-0.1cm)) ; label.rt( "$y$",(0.1cm,11.3cm)) ; \stopMPcode \stop \stoptext --047d7b1117bfa252f10510a1d391 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
To add<= /span> labels to a grid, Hans wrote a macro hlintext (Min= , Max, Step, Lenght= , Format). I do not know what to put in "Format".
Best regards,
Fabrice

\definecolor[my= color][c=3D.4,m=3D0,y=3D0,k=3D0]
\starttext
\start
\switchtobodyfont[small]
\startMPcode
=C2=A0=C2=A0=C2= =A0=C2=A0 input tex;
=C2=A0=C2=A0=C2=A0=C2=A0 numeric xmin, xmax, ymin, = ymax;
=C2=A0=C2=A0=C2=A0=C2=A0 xmin :=3D 0; xmax :=3D 22; ymax :=3D460 ;= ymin:=3D0; u :=3D 0.5cm; v:=3D 0.025cm;
=C2=A0=C2=A0=C2=A0=C2=A0 drawopt= ions(withpen pencircle scaled 0.5pt withcolor \MPcolor{mycolor});
=C2=A0= =C2=A0=C2=A0=C2=A0 draw hlingrid(ymin,ymax,20,11.5cm,11cm);
=C2=A0=C2=A0= =C2=A0=C2=A0 draw vlingrid(xmin,xmax,2,11cm,11.5cm);
=C2=A0=C2=A0=C2=A0= =C2=A0 drawoptions(withpen pencircle scaled 1pt) ;
=C2=A0=C2=A0=C2=A0=C2= =A0 drawarrow (0,0)--(22,0) scaled u ;
=C2=A0=C2=A0=C2=A0=C2=A0 drawarro= w (0,0)--(0,460) scaled v ;
=C2=A0=C2=A0=C2=A0=C2=A0 for i=3D0 step 2 un= til 20 :
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 label.bot(TEX("= $"&decimal(i)&"$"),(i,0)*u);
=C2=A0=C2=A0=C2=A0= =C2=A0 endfor;
=C2=A0=C2=A0=C2=A0=C2=A0 for i=3D0 step 20 until 440:
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 label.lft(TEX("$"&= decimal(i)&"$"),(0,i)*v);
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 e= ndfor;
=C2=A0=C2=A0=C2=A0=C2=A0 label.bot( "$x$",(10.8cm,-0.1c= m)) ;
=C2=A0=C2=A0=C2=A0=C2=A0 label.rt( "$y$",(0.1cm,11.3cm))= ;
=C2=A0=C2=A0=C2=A0
\stopMPcode
\stop
<= /div>
\stoptext
=
--047d7b1117bfa252f10510a1d391-- --===============0630803952== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============0630803952==--