From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/49041 Path: news.gmane.org!not-for-mail From: Curiouslearn Newsgroups: gmane.comp.tex.context Subject: Re: Metapost labeling question. Please help Date: Fri, 3 Apr 2009 08:47:50 -0400 Message-ID: <3b4b12310904030547u76c94079ve532aaf9a410f6a1@mail.gmail.com> References: <3b4b12310904021802o35521148t8508688ea24ea547@mail.gmail.com> <49D5EA7F.7040108@gmx.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0583556847==" X-Trace: ger.gmane.org 1238762925 6376 80.91.229.12 (3 Apr 2009 12:48:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Apr 2009 12:48:45 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Apr 03 14:50:03 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1LpiqQ-0004ez-Ro for gctc-ntg-context-518@m.gmane.org; Fri, 03 Apr 2009 14:50:02 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id F3EA81FB5B; Fri, 3 Apr 2009 14:48:36 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 19007-01-17; Fri, 3 Apr 2009 14:48:04 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 351A01FADC; Fri, 3 Apr 2009 14:48:04 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 953271FADC for ; Fri, 3 Apr 2009 14:48:01 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 31948-07-14 for ; Fri, 3 Apr 2009 14:47:54 +0200 (CEST) Original-Received: from filter1-nij.mf.surf.net (filter1-nij.mf.surf.net [195.169.124.152]) by ronja.ntg.nl (Postfix) with ESMTP id 1E0D41FA4C for ; Fri, 3 Apr 2009 14:47:54 +0200 (CEST) Original-Received: from mail-gx0-f180.google.com (mail-gx0-f180.google.com [209.85.217.180]) by filter1-nij.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n33Clq3p025209 for ; Fri, 3 Apr 2009 14:47:52 +0200 Original-Received: by gxk28 with SMTP id 28so2193982gxk.2 for ; Fri, 03 Apr 2009 05:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=2B5lGxXpXL+TIURrikR4DSGBaBDWPxiu26v4iBn3H1E=; b=mocMrs419dj75E7SKRNoZNcQDbsTeqbCwaBF8yx2bhO3bm/uWQFtSxccg/uviKcbcT NMYz4i3nKU4peWYilTPgo91/AgfFKFwChTjRFQUYgIlDLJ+0IeE1/vrgNqz9ZBrRJxsM 8E6NdL0AXlbH7AxYEx2pHuajNXg+ehRGFIYSg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=L7lnunL53nTov9yl01Smee1EvwvrbnxhE+n6oNlhrEO9LmDx4Q3WisqAu2Z2NrmSf9 uecKjB4uU60lVkm5BGgK4zW3PNAPuxJNFbB0KHmZ+U7Q6euyREXVfbvPxcGUVO2ZgDpR wHAFACG5+5sKrz77lhy6fdWobHpMjhyZ0TlC0= Original-Received: by 10.151.46.3 with SMTP id y3mr2184461ybj.139.1238762870846; Fri, 03 Apr 2009 05:47:50 -0700 (PDT) In-Reply-To: <49D5EA7F.7040108@gmx.net> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.217.180; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 203518845 - f726981127ad - 20090403 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.152 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:49041 Archived-At: --===============0583556847== Content-Type: multipart/alternative; boundary=00151750e13ae0b75c0466a5f423 --00151750e13ae0b75c0466a5f423 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mojca and Peter, thanks very much for your responses. I used Peter's solution and it worked beautifully. Does anyone know how I can change the size of these labels? If I try textext(\tfa decimal(tx)) that does not work. On Fri, Apr 3, 2009 at 6:52 AM, Peter Rolf wrote: > Curiouslearn schrieb: > >> Hi, >> >> I want the labels as (0.5,0.55,0.6,0.65,0.7,...,1) or >> (0.50,0.55,0.60,0.65,0.70,...,1). Either of these two is fine. >> >> I tried the following code for this. >> >> \starttext >> >> \startuseMPgraphic{labeltest} >> numeric rmin,rmax; >> rmin :=3D 0.5; rmax :=3D 1; >> ux :=3D 25cm; uy :=3D10cm; >> % draw axes >> draw (rmin,0)*ux -- (rmax+0.1,0)*ux; >> draw (rmin,0)*ux -- (rmin*ux,(1.1)*uy); >> for x =3D 0.5 step 0.05 until 1.1: >> label.bot(textext(decimal(x)),(x*ux,x*uy)); >> > you accumulate the rounding error with every step of the loop. try to avo= id > such 'low value' steps if possible. > > for x =3D 10 step 1 until 22: % 0.05*20 to get an integer loop index > tx :=3D x/20; % correct value > label.bot(textext(decimal(tx)),(tx*ux,tx*uy)); > > > Best wishes, Peter > > endfor; >> \stopuseMPgraphic >> >> \useMPgraphic{labeltest} >> >> \stoptext >> >> I get (0.5,0.55, 0.6,0.65001,0.70001,0.75002,...,1.00003) instead. I don= 't >> understand why I get more than 2 digits after 0.6. Is there a way to >> restrict the number of digits after the decimal point. >> Thanks very much. >> >> ------------------------------------------------------------------------ >> >> >> ________________________________________________________________________= ___________ >> If your question is of interest to others as well, please add an entry t= o >> the Wiki! >> >> maillist : ntg-context@ntg.nl / >> http://www.ntg.nl/mailman/listinfo/ntg-context >> webpage : http://www.pragma-ade.nl / http://tex.aanhet.net >> archive : https://foundry.supelec.fr/projects/contextrev/ >> wiki : http://contextgarden.net >> >> ________________________________________________________________________= ___________ >> >> > > > -- > "Es ist doch ein Trost, > das Geldgier manchmal bl=F6d macht." > > - Kottan in "Kottan ermittelt", Folge 9: "Die Einteilung" - > > > > > > _________________________________________________________________________= __________ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > > _________________________________________________________________________= __________ > --00151750e13ae0b75c0466a5f423 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mojca and Peter, thanks very much for your responses. I used Peter's so= lution and it worked beautifully.=A0

Does anyone know ho= w I can change the size of these labels? If I try=A0

textext(\tfa decimal(tx))

that does not work.= =A0

On Fri, Apr 3, 2009 at 6:52 AM= , Peter Rolf <indie= go@gmx.net> wrote:
Curiouslearn schrieb:

Hi,

I want the labels as (0.5,0.55,0.6,0.65,0.7,...,1) or (0.50,0.55,0.60,0.65,= 0.70,...,1). Either of these two is fine.

I tried the following code for this.

\starttext

\startuseMPgraphic{labeltest}
numeric rmin,rmax;
rmin :=3D 0.5; rmax :=3D 1;
ux :=3D 25cm; uy :=3D10cm;
% draw axes
draw (rmin,0)*ux -- (rmax+0.1,0)*ux;
draw (rmin,0)*ux -- (rmin*ux,(1.1)*uy);
for x =3D 0.5 step 0.05 until 1.1:
label.bot(textext(decimal(x)),(x*ux,x*uy));
you accumulate the rounding error with every step of the loop. try to avoid= such 'low value' steps if possible.

for x =3D 10 step 1 until 22: % 0.05*20 to get an integer loop index
tx :=3D x/20; % correct value
label.bot(textext(decimal(tx)),(tx*ux,tx*uy));


Best wishes, =A0Peter

endfor;
\stopuseMPgraphic

\useMPgraphic{labeltest}

\stoptext

I get (0.5,0.55, 0.6,0.65001,0.70001,0.75002,...,1.00003) instead. I don= 9;t understand why I get more than 2 digits after 0.6. Is there a way to re= strict the number of digits after the decimal point.
Thanks very much.

------------------------------------------------------------------------

___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage =A0: http://= www.pragma-ade.nl / http://tex.aanhet.net
archive =A0: https://foundry.supelec.fr/projects/contextrev/
wiki =A0 =A0 : http:= //contextgarden.net
___________________________________________________________________________= ________
=A0


--
=A0"Es ist doch ein Trost,
=A0das Geldgier manchmal bl=F6d macht."

=A0 =A0 =A0 =A0 =A0 =A0- Kottan in "Kottan ermittelt", Folge 9: = "Die Einteilung" -




___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage =A0: http://= www.pragma-ade.nl / http://tex.aanhet.net
archive =A0: https://foundry.supelec.fr/projects/contextrev/
wiki =A0 =A0 : http:= //contextgarden.net
___________________________________________________________________________= ________

--00151750e13ae0b75c0466a5f423-- --===============0583556847== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============0583556847==--