From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/83343 Path: news.gmane.org!not-for-mail From: John Kitzmiller Newsgroups: gmane.comp.tex.context Subject: Re: bar graphs, m-graph, sarith Date: Mon, 8 Jul 2013 17:28:07 -0400 Message-ID: <4D742384-8EA7-4C16-9C21-60CD443B97B0@inradius.net> References: <2DD8D00C-5A6D-4FA5-92BE-B90218600983@inradius.net> <20130707152457.2f1e8978@iram-hb-003386.extra.cea.fr> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1373318921 13001 80.91.229.3 (8 Jul 2013 21:28:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Jul 2013 21:28:41 +0000 (UTC) Cc: mailing list for ConTeXt users To: Alan BRASLAU Original-X-From: ntg-context-bounces@ntg.nl Mon Jul 08 23:28:43 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 1UwIzC-00032L-6r for gctc-ntg-context-518@m.gmane.org; Mon, 08 Jul 2013 23:28:42 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 56711101F3; Mon, 8 Jul 2013 23:28:41 +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 S9vPN9WfYOv8; Mon, 8 Jul 2013 23:28:38 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id ED61C101E5; Mon, 8 Jul 2013 23:28:37 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F12EB101E5 for ; Mon, 8 Jul 2013 23:28:35 +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 MwUtP0JvC4gC for ; Mon, 8 Jul 2013 23:28:34 +0200 (CEST) Original-Received: from filter1-utr.mf.surf.net (filter1-utr.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id E316E101E4 for ; Mon, 8 Jul 2013 23:28:23 +0200 (CEST) Original-Received: from bosmailout01.eigbox.net (bosmailout01.eigbox.net [66.96.185.1]) by filter1-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r68LSMIj010543 for ; Mon, 8 Jul 2013 23:28:22 +0200 Original-Received: from bosmailscan03.eigbox.net ([10.20.15.3]) by bosmailout01.eigbox.net with esmtp (Exim) id 1UwIyr-0000lI-9i for ntg-context@ntg.nl; Mon, 08 Jul 2013 17:28:21 -0400 Original-Received: from bosmailscan25.eigbox.net ([10.20.15.25]) by bosmailscan03.eigbox.net with esmtp (Exim) id 1UwIyq-0006MO-Ug for ntg-context@ntg.nl; Mon, 08 Jul 2013 17:28:20 -0400 Original-Received: from bosimpout04.eigbox.net ([10.20.55.4]) by bosmailscan25.eigbox.net with esmtp (Exim) id 1UwIyq-0005tn-SF; Mon, 08 Jul 2013 17:28:20 -0400 Original-Received: from bosauthsmtp07.eigbox.net ([10.20.18.7]) by bosimpout04.eigbox.net with NO UCE id xxUL1l00J099BUA01xULVY; Mon, 08 Jul 2013 17:28:20 -0400 X-Authority-Analysis: v=2.0 cv=dt1Z+ic4 c=1 sm=1 a=LYHOkWP7CQS3se81pmgmsw==:17 a=esbi5I81GEsA:10 a=wSZGMFCSS-4A:10 a=IAVadmt-b2IA:10 a=kj9zAlcOel0A:10 a=y85PGfU6AAAA:8 a=lS0MHldHvS4A:10 a=9ZbNeDFEwqwA:10 a=4vKBqJnQtynTT6ZropwA:9 a=CjuIK1q_8ugA:10 a=8SmTvVVA6LsA:10 a=x8qw8EAkfcRkIpZA8Q87Bg==:117 X-EN-OrigOutIP: 10.20.18.7 X-EN-IMPSID: xxUL1l00J099BUA01xULVY Original-Received: from c-66-31-143-215.hsd1.nh.comcast.net ([66.31.143.215] helo=[10.0.0.3]) by bosauthsmtp07.eigbox.net with esmtpsa (TLSv1:AES128-SHA:128) (Exim) id 1UwIyq-00044G-Ji; Mon, 08 Jul 2013 17:28:20 -0400 In-Reply-To: <20130707152457.2f1e8978@iram-hb-003386.extra.cea.fr> X-Mailer: Apple Mail (2.1283) X-EN-UserInfo: 08df34410b47fe835bedcf202d0c2be6:a300556557b4989761417475c2eece72 X-EN-AuthUser: kitz@inradius.net X-EN-OrigIP: 66.31.143.215 X-EN-OrigHost: c-66-31-143-215.hsd1.nh.comcast.net X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=66.96.185.1; country=US; region=MA; city=Burlington; postalcode=01803; latitude=42.5051; longitude=-71.2047; metrocode=506; areacode=781; http://maps.google.com/maps?q=42.5051,-71.2047&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07JVVsmUs - a34c2d5f80c1 - 20130708 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) 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:83343 Archived-At: Thank you Alan. That was exactly the redirection needed. John On Jul 7, 2013, at 9:24 AM, Alan BRASLAU wrote: > 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 ___________________________________________________________________________________