From: Michael H. <mh...@al...> - 2011-07-03 15:04:33
|
On 07/03/2011 11:54 AM, tony wrote: > Thanks Michael > I can now place a label on the graph, but what I really want to do is > have the label be a variable that is updated every few seconds. > I've tried to include this in > g('set label 1 sprintf("%f",inc) at 2,2') > where inc is the variable but in a While loop I keep getting an > undefined variable error, even though the variable is defined in the > line above. I've seen this done in other scripts, but not necessarily in > a while loop - is that the problem? It sounds like you are defining the variable "inc" in Python but then expecting gnuplot to know how to put it into a string. Either you have to define the variable in gnuplot or you have to do the string interpolation in Python. You might try the "debug" option to the Gnuplot constructor to see what commands it is passing to gnuplot. That might make the situation clearer. Michael -- Michael Haggerty mh...@al... http://softwareswirl.blogspot.com/ |