From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/86303 Path: news.gmane.org!not-for-mail From: Herbert Voss Newsgroups: gmane.comp.tex.context Subject: Re: Pgfplots - passing point coordinates by Lua Date: Sun, 16 Feb 2014 22:56:21 +0100 Organization: Freie =?windows-1252?Q?Universit=E4t_Berlin?= Message-ID: <53013405.3070004@FU-Berlin.DE> References: <5301123B.3030901@FU-Berlin.DE> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; Format="flowed" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1392587797 7629 80.91.229.3 (16 Feb 2014 21:56:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Feb 2014 21:56:37 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Sun Feb 16 22:56:46 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 1WF9hd-0002XQ-4G for gctc-ntg-context-518@m.gmane.org; Sun, 16 Feb 2014 22:56:45 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 505B3101E9; Sun, 16 Feb 2014 22:56:44 +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 vdnxaEOrBScA; Sun, 16 Feb 2014 22:56:42 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id E76D2101E6; Sun, 16 Feb 2014 22:56:41 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F0193101E6 for ; Sun, 16 Feb 2014 22:56:39 +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 XMbj3CcG6uIM for ; Sun, 16 Feb 2014 22:56:38 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 24908101E2 for ; Sun, 16 Feb 2014 22:56:28 +0100 (CET) Original-Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s1GLuRqm008854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 16 Feb 2014 22:56:27 +0100 Original-Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.82) for ntg-context@ntg.nl with esmtp (envelope-from ) id <1WF9hK-002ZSX-Un>; Sun, 16 Feb 2014 22:56:26 +0100 Original-Received: from p54bf838b.dip0.t-ipconnect.de ([84.191.131.139] helo=shania.localdomain.de) by inpost2.zedat.fu-berlin.de (Exim 4.82) for ntg-context@ntg.nl with esmtpsa (envelope-from ) id <1WF9hK-000FET-8W>; Sun, 16 Feb 2014 22:56:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: X-Originating-IP: 84.191.131.139 X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=130.133.4.66; country=DE; region=16; city=Berlin; latitude=52.5167; longitude=13.4000; http://maps.google.com/maps?q=52.5167,13.4000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QLr9Urpv - 25f496784b04 - 20140216 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 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:86303 Archived-At: Am 16.02.2014 21:39, schrieb Luk=E1=9A Proch=E1zka: > \startluacode > data =3D {{5, 15}, {20, 20}, {24, -24}} > > data2crds =3D function(data) > local str > > for i, v in ipairs(data) do > str =3D (str or "") .. "(" .. v[1] .. "," .. v[2] .. ")" > end > > print("Crds=3D", str) > > return str > end > > -- > > plot =3D function(data) > context.starttikzpicture() > context.startaxis{} > context.addplot{mark=3D"none",color=3D"red"} > context("coordinates {" .. data2crds(data) .. "};") this line would be enough with \ctxlua{...} Herbert > context.stopaxis() > context.stoptikzpicture() > end > \stopluacode > > \starttext > \starttikzpicture > \startaxis[] > \addplot[mark=3Dnone,color=3Dred] coordinates {(11, 5) (12, 18)}; > \stopaxis > \stoptikzpicture > > \ctxlua{plot(data)} > \stoptext > ---- > > Anyway, thanks. > > Best regards, > > Lukas > >> >> Herbert > > > > > _________________________________________________________________________= __________ > 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 : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ > ___________________________________________________________________________= ________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________