From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/86312 Path: news.gmane.org!not-for-mail From: Jaroslav Hajtmar Newsgroups: gmane.comp.tex.context Subject: Re: Pgfplots - passing point coordinates by Lua Date: Mon, 17 Feb 2014 01:11:44 +0100 Message-ID: <530153C0.30405@gyza.cz> References: <530142F0.5040703@gyza.cz> Reply-To: hajtmar@gyza.cz, mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1392595959 22442 80.91.229.3 (17 Feb 2014 00:12:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Feb 2014 00:12:39 +0000 (UTC) Cc: mailing list for ConTeXt users To: DesdeChaves Original-X-From: ntg-context-bounces@ntg.nl Mon Feb 17 01:12:48 2014 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 1WFBpI-0005qt-Kt for gctc-ntg-context-518@m.gmane.org; Mon, 17 Feb 2014 01:12:48 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 441351020A; Mon, 17 Feb 2014 01:12:47 +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 C7wQJPHxTAWh; Mon, 17 Feb 2014 01:12:45 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 3AE40101E6; Mon, 17 Feb 2014 01:12:45 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DF72D101E6 for ; Mon, 17 Feb 2014 01:12:43 +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 XWQdS3tDQ6Gw for ; Mon, 17 Feb 2014 01:12:32 +0100 (CET) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 18AA4101E2 for ; Mon, 17 Feb 2014 01:12:21 +0100 (CET) Original-Received: from h1.cmg1.smtp.forpsi.com (h1.cmg1.smtp.forpsi.com [81.2.195.162]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s1H0CLGO011126 for ; Mon, 17 Feb 2014 01:12:21 +0100 Original-Received: from [192.168.20.100] ([88.103.230.14]) by cmg1.smtp.forpsi.com with bizsmtp id TCCK1n0010KHK6001CCLeZ; Mon, 17 Feb 2014 01:12:20 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=81.2.195.162; country=CZ; latitude=49.7500; longitude=15.5000; http://maps.google.com/maps?q=49.7500,15.5000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03Lrccl93 - c7ca955f26f7 - 20140217 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.71 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:86312 Archived-At: Thanks Jorge for the helpful and useful instructions. Sometimes it will certainly come in handy. Jaroslav Hajtmar Dne 17.2.2014 0:53, DesdeChaves napsal(a): > \usemodule[tikz] > \usemodule[pgfplots] > \usemodule[pgfplotstable] > > \starttext > > \startluacode > > local dados={}; > > for i=1,10 do > dados[i]=2*i > end > > context("\\starttikzpicture") > context("\\pgfplotsset{width=10cm, compat=1.3, legend > style={font=\\tfx}}") > context("\\startaxis[") > context("xlabel={L (m) },") > context("ylabel={ $T^2 (s^2)$},legend cell align=left, legend > pos=north west]") > context("\\addplot[only marks] table[row sep=\\\\]{") > context("X Y\\\\") > for key,value in pairs(dados) do > context("%0.2f %0.1f \\\\", key, value) > end > context(" };") > context("\\addlegendentry{Experimental points}") > context("\\addplot table[row sep=\\\\,") > context("y={create col/linear regression={y=Y}}]{") > context("X Y\\\\") > for key,value in pairs(dados) do > context("%0.2f %0.1f \\\\", key, value) > end > context("};") > context("\\addlegendentry{") > context("$\\pgfmathprintnumber{\\pgfplotstableregressiona} \\cdot x") > context("\\pgfmathprintnumber[print > sign]{\\pgfplotstableregressionb}$ lin. Regression}") > context("\\stopaxis") > context("\\stoptikzpicture") > > \stopluacode > > > \stoptext ___________________________________________________________________________________ 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 ___________________________________________________________________________________