Gnuplot.py and, _by far_, the weirdest thing I've ever seen on my computer

syd syd.diamond at gmail.com
Mon Apr 4 17:23:10 EDT 2005


I don't even know where to begin.  This is just bizarre.  I just picked
up the Gnuplot.py module (a light interface to gnuplot commands) and
was messing around with it today.

I've got a tiny script, but it only works from the command line about
half the time!  In the python interpreter, 100%.   Ipython, 100%.  I'm
not kidding.

#!/bin/env python
import Gnuplot
g = Gnuplot.Gnuplot(debug=1)
g.title('A simple example')
g('set data style linespoints')
g('set terminal png small color')
g('set output "myGraph.png"')
g.plot([[0,1.1], [1,5.8], [2,3.3], [3,100]])

Here's just one example -- it does not work, then it works.  It seems
totally random.  It will work a few times, then it won't for a few
times...

bash-2.05b$ ./myGnu.py
gnuplot> set title "A simple example"
gnuplot> set data style linespoints
gnuplot> set terminal png small color
gnuplot> set output "myGraph.png"
gnuplot> plot '/tmp/tmp5LXAow' notitle

gnuplot> plot '/tmp/tmp5LXAow' notitle
              ^
         can't read data file "/tmp/tmp5LXAow"
         line 0: util.c: No such file or directory

bash-2.05b$ ./myGnu.py
gnuplot> set title "A simple example"
gnuplot> set data style linespoints
gnuplot> set terminal png small color
gnuplot> set output "myGraph.png"
gnuplot> plot '/tmp/tmpHMTkpL' notitle

(and it makes the graph image just fine)

I mean what the hell is going on?  My permissions on /tmp are wide open
(drwxrwxrwt).  It does the same thing when I run as root.  And it
_always_ works when I use the interpreter or interactive python.

Any clues would be greatly appreciated.  I'm baffled.




More information about the Python-list mailing list