From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/83332 Path: news.gmane.org!not-for-mail From: Alan BRASLAU Newsgroups: gmane.comp.tex.context Subject: Re: bar graphs, m-graph, sarith Date: Sun, 7 Jul 2013 15:24:57 +0200 Organization: CEA DSM-IRAMIS-SPEC Message-ID: <20130707152457.2f1e8978@iram-hb-003386.extra.cea.fr> References: <2DD8D00C-5A6D-4FA5-92BE-B90218600983@inradius.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1373203516 1550 80.91.229.3 (7 Jul 2013 13:25:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Jul 2013 13:25:16 +0000 (UTC) Cc: mailing list for ConTeXt users To: kitz@inradius.net Original-X-From: ntg-context-bounces@ntg.nl Sun Jul 07 15:25:18 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Uvoxo-00069F-NH for gctc-ntg-context-518@m.gmane.org; Sun, 07 Jul 2013 15:25:16 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3E49B101EC; Sun, 7 Jul 2013 15:25:15 +0200 (CEST) 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 nzSB3pPXkco7; Sun, 7 Jul 2013 15:25:13 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id D220C101E8; Sun, 7 Jul 2013 15:25:13 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B500F101E8 for ; Sun, 7 Jul 2013 15:25:12 +0200 (CEST) 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 ekbw04ZSiva4 for ; Sun, 7 Jul 2013 15:25:11 +0200 (CEST) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by balder.ntg.nl (Postfix) with ESMTP id A1033101E0 for ; Sun, 7 Jul 2013 15:25:01 +0200 (CEST) Original-Received: from oxalide-out.extra.cea.fr (oxalide-out.extra.cea.fr [132.168.224.8]) by filter1-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r67DP0ik015197 for ; Sun, 7 Jul 2013 15:25:01 +0200 Original-Received: from epeire1.extra.cea.fr (epeire1.extra.cea.fr [132.167.198.31]) by oxalide.extra.cea.fr (8.14.2/8.14.2/CEAnet-Internet-out-2.3) with ESMTP id r67DOwdD013650 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 7 Jul 2013 15:24:58 +0200 Original-Received: from orpin2.extra.cea.fr (orpin2.extra.cea.fr [132.167.198.5]) by epeire1.extra.cea.fr (8.14.4/8.14.4) with ESMTP id r67DOwmu016054; Sun, 7 Jul 2013 15:24:58 +0200 (envelope-from alan.braslau@cea.fr) Original-Received: from iram-hb-003386.extra.cea.fr (charybde.extra.cea.fr [132.166.43.102]) by orpin2.extra.cea.fr (8.13.8/8.13.8/CEAnet-Intranet-out-1.2) with ESMTP id r67DOvMq013864; Sun, 7 Jul 2013 15:24:57 +0200 In-Reply-To: <2DD8D00C-5A6D-4FA5-92BE-B90218600983@inradius.net> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.19; amd64-portbld-freebsd9.1) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=132.168.224.8; country=FR; region=A3; city=Gif-sur-yvette; latitude=48.6833; longitude=2.1333; http://maps.google.com/maps?q=48.6833,2.1333&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0NJVpp1ID - da379ec134cf - 20130707 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 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-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:83332 Archived-At: Metapost now has double precision arithmetic, so one no longer needs to use the string arithmetic macros. However, it may be necessary to use scantokens as in clearxy; z = (scantokens v1, scantokens v2); augment.p(x,0); augment.p(x,y); x := x + 0.4 ; augment.p(x,y); augment.p(x,0); Alan On Sat, 6 Jul 2013 22:01:06 -0400 John Kitzmiller wrote: > When trying to make a bar graph with m-graph.mkiv and sarith, the > command Ssub (string subtract) seems to augment.p(v1 Sadd > "0.4",v2);Sadd instead. An mwe of a bar graph: > > (data1 is a separate file containing > 01 02 > 02 03) > > \usemodule[m-graph] > \startMPpage[instance=graph] > input sarith; > draw begingraph(5cm,5cm); > gdata("data1", v, > path p; > augment.p(v1,0); > augment.p(v1,v2) > augment.p(v1 Sadd "0.4",v2); > augment.p(v1 Sadd "0.4",0); > gfill p--cycle withcolor .8white; > gdraw p--cycle; > ); > endgraph; > \stopMPpage > > ...which gives bars of width 0.4 starting at abscissa 1 and 2 as > expected. To increase the width of the bars to 0.8 and have them > centered over 1 and 2, I expect to Ssub from the first two augments: > > \usemodule[m-graph] > \startMPpage[instance=graph] > input sarith; > draw begingraph(5cm,5cm); > gdata("data1", v, > path p; > augment.p(v1 Ssub "0.4",0); > augment.p(v1 Ssub "0.4",v2); > augment.p(v1 Sadd "0.4",v2); > augment.p(v1 Sadd "0.4",0); > gfill p--cycle withcolor .8white; > gdraw p--cycle; > ); > endgraph; > \stopMPpage > > However, the Ssub adds instead and gives a line at 1.4 and 2.4. > > Compiling the above with mpost or mptopdf gives the desired > result(s), but I am curious if this can be resolved so such bar > graphs could be made within ConTeXT/METAFUN. > > Thanks! John ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________