From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/49037 Path: news.gmane.org!not-for-mail From: Peter Rolf Newsgroups: gmane.comp.tex.context Subject: Re: Metapost labeling question. Please help Date: Fri, 03 Apr 2009 12:52:47 +0200 Message-ID: <49D5EA7F.7040108@gmx.net> References: <3b4b12310904021802o35521148t8508688ea24ea547@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1238756030 17306 80.91.229.12 (3 Apr 2009 10:53:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Apr 2009 10:53:50 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Apr 03 12:55:08 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 1Lph3C-0000vq-78 for gctc-ntg-context-518@m.gmane.org; Fri, 03 Apr 2009 12:55:06 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5D7ED1FB38; Fri, 3 Apr 2009 12:53:40 +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 31903-03; Fri, 3 Apr 2009 12:53:11 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 00F2A1FADB; Fri, 3 Apr 2009 12:53:11 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 289701FADB for ; Fri, 3 Apr 2009 12:53:09 +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 21812-05 for ; Fri, 3 Apr 2009 12:53:01 +0200 (CEST) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by ronja.ntg.nl (Postfix) with ESMTP id 05A2F1FAD7 for ; Fri, 3 Apr 2009 12:53:01 +0200 (CEST) Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by filter4-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with SMTP id n33Aqner022346 for ; Fri, 3 Apr 2009 12:52:56 +0200 Original-Received: (qmail invoked by alias); 03 Apr 2009 10:52:48 -0000 Original-Received: from i577BD159.versanet.de (EHLO [192.168.1.3]) [87.123.209.89] by mail.gmx.net (mp064) with SMTP; 03 Apr 2009 12:52:48 +0200 X-Authenticated: #24293357 X-Provags-ID: V01U2FsdGVkX1/4q4JIX/T4c0qyyBr+NNOwOZZeF7k5lGUI+ZvUKU FxtFXlSUWFYZbH User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: <3b4b12310904021802o35521148t8508688ea24ea547@mail.gmail.com> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.165.64.20; country=DE; region=01; city=Karlsruhe; latitude=49.0047; longitude=8.3858; http://maps.google.com/maps?q=49.0047,8.3858&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 203451356 - 32aceeb0ea34 - 20090403 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.220 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:49037 Archived-At: 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, 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 to= the Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-co= ntext > 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 t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________