Re: [NTG-context] Lua and module gnuplot: Manipulate Gnuplot script with Lua

2011-12-13 Thread Hans Hagen
On 12-12-2011 23:35, Paul Menzel wrote: \def\E#1{$10^{#1}$} \unexpanded\def\E \startGNUPLOTscript[name] set logscale y set format y \\E{%T} plot sin(x) t '$\sin(x) [\E{3}]$' # usually something else with logscale, but just to show the point

[NTG-context] Lua and module gnuplot: Manipulate Gnuplot script with Lua

2011-12-12 Thread Paul Menzel
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

Re: [NTG-context] Lua and module gnuplot: Manipulate Gnuplot script with Lua

2011-12-12 Thread Mojca Miklavec
On Mon, Dec 12, 2011 at 22:39, Paul Menzel wrote: 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

Re: [NTG-context] Lua and module gnuplot: Manipulate Gnuplot script with Lua

2011-12-12 Thread Mojca Miklavec
On Mon, Dec 12, 2011 at 23:07, Mojca Miklavec wrote: However, \startGNUPLOTinclusions is parsed and you could in theory misuse that, but it would be very bad coding practice. (Wait, I'm not sure about that. I think that I fixed that for the same reason, but I need to check.) Either way the

Re: [NTG-context] Lua and module gnuplot: Manipulate Gnuplot script with Lua

2011-12-12 Thread Hans Hagen
On 12-12-2011 22:39, Paul Menzel wrote: 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

Re: [NTG-context] Lua and module gnuplot: Manipulate Gnuplot script with Lua

2011-12-12 Thread Hans Hagen
On 12-12-2011 23:13, Mojca Miklavec wrote: Either way the moral of the story is still the same: context parsing is very very very confusing and you don't want to go there. In particular you never know if something should be parsed and executed before or after gnuplot processing. Actually this

Re: [NTG-context] Lua and module gnuplot: Manipulate Gnuplot script with Lua

2011-12-12 Thread Mojca Miklavec
On Mon, Dec 12, 2011 at 23:17, Hans Hagen wrote: You have to twist your mide a bit: \startluacode  local x = 10  context.startGNUPLOTscript{ lua }  context(plot %s,1.2 * x + 3)  context.stopGNUPLOTscript() \stopluacode \starttext \useGNUPLOTgraphic[lua] \stoptext Oh, I like this

Re: [NTG-context] Lua and module gnuplot: Manipulate Gnuplot script with Lua

2011-12-12 Thread Paul Menzel
Am Montag, den 12.12.2011, 23:07 +0100 schrieb Mojca Miklavec: On Mon, Dec 12, 2011 at 22:39, Paul Menzel wrote: 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

Re: [NTG-context] Lua and module gnuplot: Manipulate Gnuplot script with Lua

2011-12-12 Thread Paul Menzel
Am Montag, den 12.12.2011, 23:13 +0100 schrieb Mojca Miklavec: […] One more example. One thing that would most probably work (I didn't try it) would be the following: \startGNUPLOTscript[name] plot sin(x) t '$\pi = \ctxlua{math.pi()}$' \stopGNUPLOTscript It has some syntax errors, but

Re: [NTG-context] Lua and module gnuplot: Manipulate Gnuplot script with Lua

2011-12-12 Thread Aditya Mahajan
On Mon, 12 Dec 2011, Mojca Miklavec wrote: On Mon, Dec 12, 2011 at 23:17, Hans Hagen wrote: You have to twist your mide a bit: \startluacode  local x = 10  context.startGNUPLOTscript{ lua }  context(plot %s,1.2 * x + 3)  context.stopGNUPLOTscript() \stopluacode \starttext

Re: [NTG-context] Lua and module gnuplot: Manipulate Gnuplot script with Lua

2011-12-12 Thread Aditya Mahajan
On Mon, 12 Dec 2011, Mojca Miklavec wrote: It would be a lot better to come up with some proposal how to change the interface to enable what you want to do. (To be honest, it is still on my todo list to migrate to Aditya's filter module in the background, but I don't find the courage to start