From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/73118 Path: news.gmane.org!not-for-mail From: Paul Menzel Newsgroups: gmane.comp.tex.context Subject: Lua and module gnuplot: Manipulate Gnuplot script with Lua Date: Mon, 12 Dec 2011 22:39:24 +0100 Message-ID: <1323725964.26949.90.camel@mattotaupa> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0803300773==" X-Trace: dough.gmane.org 1323725992 20095 80.91.229.12 (12 Dec 2011 21:39:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 12 Dec 2011 21:39:52 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Mon Dec 12 22:39:45 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RaDb4-0007eK-Rh for gctc-ntg-context-518@m.gmane.org; Mon, 12 Dec 2011 22:39:42 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 42AB8CB166; Mon, 12 Dec 2011 22:39:42 +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 BsBfWFxQximr; Mon, 12 Dec 2011 22:39:39 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8AED6CB163; Mon, 12 Dec 2011 22:39:39 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 119D0CB163 for ; Mon, 12 Dec 2011 22:39: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 TiO3x6rN1ggU for ; Mon, 12 Dec 2011 22:39:28 +0100 (CET) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 16213CB15F for ; Mon, 12 Dec 2011 22:39:28 +0100 (CET) Original-Received: from mail.gw90.de (mail.gw90.de [188.40.100.199]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pBCLdRhc014268 for ; Mon, 12 Dec 2011 22:39:27 +0100 Original-Received: from f053045170.adsl.alicedsl.de ([78.53.45.170] helo=[192.168.178.21]) by mail.gw90.de with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1RaDaq-0004sU-5g for ntg-context@ntg.nl; Mon, 12 Dec 2011 21:39:28 +0000 X-Mailer: Evolution 3.0.3-2 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=188.40.100.199; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08G8lDrBl - eb8606a584d5 - 20111212 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:73118 Archived-At: --===============0803300773== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-ZVhelxa6oDXchF968qfX" --=-ZVhelxa6oDXchF968qfX Content-Type: multipart/mixed; boundary="=-aAISNOavNIEsuEnMUeh2" --=-aAISNOavNIEsuEnMUeh2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear ConTeXt folks, I have two coefficients saved in a text file -0.157737135681261 -0.211443105668896 and I want to use them to plot a line with gnuplot. Having several of those files I want to use Lua to create the formula for the line for me. I have not yet figured out how to read values from a file in Lua and just tried to print a constant to the gnuplot command. I tried the following. \usemodule[gnuplot] =20 \startGNUPLOTscript[lua] plot \ctxlua{context(1.2 * x + 3)} \stopGNUPLOTscript =20 \startGNUPLOTscript[nolua] plot 1.2 * x + 3 \stopGNUPLOTscript =20 \starttext \useGNUPLOTgraphic[lua] =20 Above should be a plot. =20 \useGNUPLOTgraphic[nolua] =20 \blank \CONTEXT\ \contextmark\ \contextversion \stoptext But only the second plot done and for the first the following error is shown. mtxrun | mtxrun | executing: gnuplot gnup-gnuplot-1.plt mtxrun | mtxrun | plot \ctxlua{context(1.2 * x + 3)} ^ "gnup-gnuplot-1.tmp", line 1: invalid character \ Is there a way to manipulate gnuplot scripts with Lua? Thanks, Paul --=-aAISNOavNIEsuEnMUeh2 Content-Disposition: attachment; filename="gnup.tex" Content-Type: text/x-tex; name="gnup.tex"; charset="UTF-8" Content-Transfer-Encoding: base64 XHVzZW1vZHVsZVtnbnVwbG90XQ0KDQpcc3RhcnRHTlVQTE9Uc2NyaXB0W2x1YV0NCiAgIHBsb3Qg XGN0eGx1YXtjb250ZXh0KDEuMiAqIHggKyAzKX0NClxzdG9wR05VUExPVHNjcmlwdA0KDQpcc3Rh cnRHTlVQTE9Uc2NyaXB0W25vbHVhXQ0KICAgcGxvdCAxLjIgKiB4ICsgMw0KXHN0b3BHTlVQTE9U c2NyaXB0DQoNClxzdGFydHRleHQNClx1c2VHTlVQTE9UZ3JhcGhpY1tsdWFdDQoNCkFib3ZlIHNo b3VsZCBiZSBhIHBsb3QuDQoNClx1c2VHTlVQTE9UZ3JhcGhpY1tub2x1YV0NCg0KXGJsYW5rDQpc Q09OVEVYVFwgXGNvbnRleHRtYXJrXCBcY29udGV4dHZlcnNpb24NClxzdG9wdGV4dA0K --=-aAISNOavNIEsuEnMUeh2-- --=-ZVhelxa6oDXchF968qfX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAk7mdIwACgkQPX1aK2wOHVjvzgCeNvfFse0GPmtZft95WjBgdjMp 1F8AniT2AyZZ4XlIFsthajBcLIEvfz9O =FaCl -----END PGP SIGNATURE----- --=-ZVhelxa6oDXchF968qfX-- --===============0803300773== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0803300773==--