HappyDoc Generated Documentation | Gnuplot/FAQ.txt |
---|---|
/ Gnuplot / FAQ.txt # $Id: FAQ.txt 294 2006-11-07 02:33:08Z parejkoj $ Frequently Asked Questions 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, ====================================================================== Q1: When running the following script ------------------------------------------------ #! /usr/bin/python2 import Gnuplot, Gnuplot.funcutils from numpy import * g = Gnuplot.Gnuplot() g.plot([[0,1.1], [1,5.8], [2,3.3], [3,4.2]]) ------------------------------------------------ I get the error gnuplot> plot 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.) To prevent this problem, there are several possibilities:
====================================================================== Q2: Does Gnuplot.py work under Jython/Java? A2: Partly. Version 1.7 added the low-level interface gp_java.py for communicating with gnuplot using the Java libraries, and that part seems to work. However, Gnuplot.py relies on the Python Numeric library, which is a C
library. The Jython equivalent, called JNumeric
====================================================================== Q3: [from Tate Wilson] I am trying to set up your gnuplot/python package on my mac (osX). The readme file says I need to convert the files to mac text files. The coverter I usually use, maclink, won't handle these files. Can you give me a hint how to convert the files or where to look for help? 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 ====================================================================== Q4: I am using Windows and I get an error like > Traceback (most recent call last):
> [...]
> File "C:\Python23\Lib\site-packages\Gnuplot\gp_win32.py",
> line 125, in __call__
> self.write(s + What is the problem? 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. |