Beruflich Dokumente
Kultur Dokumente
This file is meant to answer the most frequently asked questions about
the Gnuplot.py package. If you want to suggest additional questions
(with or without answers!) please mail them to the Gnuplot.py users
mailing list, <gnuplot-py-users@lists.sourceforge.net>.
======================================================================
Q1:
------------------------------------------------
#! /usr/bin/python2
g = Gnuplot.Gnuplot()
g.plot([[0,1.1], [1,5.8], [2,3.3], [3,4.2]])
------------------------------------------------
However, the same commands work fine if I type them into the
interpreter! What's wrong?
A1:
The problem is that in many cases Gnuplot.py sends data to gnuplot via
a temporary file. But Gnuplot.py has no way of knowing when it is
safe to delete the temporary file. So it deletes it when the
corresponding PlotItem object is deleted, which is typically when the
next Gnuplot.plot() command is executed or when the python script
ends. (Until you plot something else, the Gnuplot object keeps a
reference to all of the old plot items to prevent their being garbage
collected.)
======================================================================
Q2:
A2:
======================================================================
Q3:
A3:
I don't know. But the same user later reported what worked for him:
I did have to convert the files. It may not be true for all mac
Python users, but I suspect it is. I'm using a graphical Python
development environment called "Python IDE for mac" which may have its
own pickiness, but still, it wouldn't even recognize the files in your
package as being the type it could open. I tried a few different file
converters with no luck. Then I just opened all the files with
BBedit, changed something so I would be prompted to save it on closing
(like add and remove a letter), and closed BBedit. Then all the files
were 'mac' files and the Python interpreter recognised them.
======================================================================
Q4:
A4:
This is apparently the error that results when Gnuplot.py cannot start
the pgnuplot.exe executable under Windows. It could be that gnuplot
(the plotting program, as opposed to Gnuplot.py) is not installed, or
that it is not in your PATH. If your pgnuplot.exe executable is named
differently, or you do not want to add its directory to your PATH, you
can change gnuplot_command in gp_win32.py to indicate the precise path
to the executable.