PyFoam.ThirdParty.Gnuplot.gp_unix module¶
gp_unix – an interface to gnuplot used for unix platforms.
This file implements a low-level interface to a gnuplot program for a unix platform (actually it is used for any non-Windows, non-Mac system). This file should be imported through gp.py, which in turn should be imported via ‘import Gnuplot’ rather than these low-level interfaces.
-
class
PyFoam.ThirdParty.Gnuplot.gp_unix.
GnuplotOpts
[source]¶ Bases:
object
The configuration options for gnuplot on generic platforms.
Store the options in a class to make them easy to import and modify en masse. If you want to modify the options from the command line or within a running program, do something like the following:
import Gnuplot Gnuplot.GnuplotOpts.gnuplot_command = '/bin/mygnuplot'
-
default_lpr
= '| lpr'¶
-
default_term
= 'x11'¶
-
gnuplot_command
= 'gnuplot'¶
-
prefer_enhanced_postscript
= 1¶
-
prefer_fifo_data
= 1¶
-
prefer_inline_data
= 0¶
-
prefer_persist
= 0¶
-
recognizes_binary_splot
= 1¶
-
recognizes_persist
= None¶
-
support_fifo
= 1¶
-
-
class
PyFoam.ThirdParty.Gnuplot.gp_unix.
GnuplotProcess
(persist=None, quiet=False)[source]¶ Bases:
object
Unsophisticated interface to a running gnuplot program.
This represents a running gnuplot program and the means to communicate with it at a primitive level (i.e., pass it commands or data). When the object is destroyed, the gnuplot program exits (unless the ‘persist’ option was set). The communication is one-way; gnuplot’s text output just goes to stdout with no attempt to check it for error messages.
Members:
‘gnuplot’ – the pipe to the gnuplot command.Methods:
‘__init__’ – start up the program.
- ‘__call__’ – pass an arbitrary string to the gnuplot program,
- followed by a newline.
‘write’ – pass an arbitrary string to the gnuplot program.
‘flush’ – cause pending output to be written immediately.
‘close’ – close the connection to gnuplot.
-
PyFoam.ThirdParty.Gnuplot.gp_unix.
test_persist
()[source]¶ Determine whether gnuplot recognizes the option ‘-persist’.
If the configuration variable ‘recognizes_persist’ is set (i.e., to something other than ‘None’), return that value. Otherwise, try to determine whether the installed version of gnuplot recognizes the -persist option. (If it doesn’t, it should emit an error message with ‘-persist’ in the first line.) Then set ‘recognizes_persist’ accordingly for future reference.