|
From: Richard L. <la...@un...> - 2013-12-10 03:54:37
|
In a Python script, I compute the value of a variable. Let's call it cep. I then want to draw a circle whose radius is cep. I would like to have something like
cep = (some calculation producing a float value)
g('set parametric')
g('set trange [0:2*pi]')
g('fx(t) = cep*cos(t)')
g('fy(t) = cep*sin(t)')
e = Gnuplot.Func('fx(t),fy(t)')
g.plot(e)
but that doesn't work, it seems, as gnuplot doesn't know the value of cep ("undefined variable: cep"). So how does one pass an arbitrary variable value to gnuplot-py?
-- Richard Langley
-----------------------------------------------------------------------------
| Richard B. Langley E-mail: la...@un... |
| Geodetic Research Laboratory Web: http://gge.unb.ca |
| Dept. of Geodesy and Geomatics Engineering Phone: +1 506 453-5142 |
| University of New Brunswick Fax: +1 506 453-4943 |
| Fredericton, N.B., Canada E3B 5A3 |
| Fredericton? Where's that? See: http://www.fredericton.ca/ |
-----------------------------------------------------------------------------
|