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'
-
__dict__
= mappingproxy({'__module__': 'PyFoam.ThirdParty.Gnuplot.gp_unix', '__doc__': "The configuration options for gnuplot on generic platforms.\n\n Store the options in a class to make them easy to import and\n modify en masse. If you want to modify the options from the\n command line or within a running program, do something like the\n following::\n\n import Gnuplot\n Gnuplot.GnuplotOpts.gnuplot_command = '/bin/mygnuplot'\n\n ", 'gnuplot_command': 'gnuplot', 'recognizes_persist': None, 'prefer_persist': 0, 'recognizes_binary_splot': 1, 'prefer_inline_data': 0, 'support_fifo': 1, 'prefer_fifo_data': 1, 'default_term': 'x11', 'default_lpr': '| lpr', 'prefer_enhanced_postscript': 1, '__dict__': <attribute '__dict__' of 'GnuplotOpts' objects>, '__weakref__': <attribute '__weakref__' of 'GnuplotOpts' objects>})¶
-
__module__
= 'PyFoam.ThirdParty.Gnuplot.gp_unix'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
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.
-
__dict__
= mappingproxy({'__module__': 'PyFoam.ThirdParty.Gnuplot.gp_unix', '__doc__': "Unsophisticated interface to a running gnuplot program.\n\n This represents a running gnuplot program and the means to\n communicate with it at a primitive level (i.e., pass it commands\n or data). When the object is destroyed, the gnuplot program exits\n (unless the 'persist' option was set). The communication is\n one-way; gnuplot's text output just goes to stdout with no attempt\n to check it for error messages.\n\n Members:\n\n 'gnuplot' -- the pipe to the gnuplot command.\n\n Methods:\n\n '__init__' -- start up the program.\n\n '__call__' -- pass an arbitrary string to the gnuplot program,\n followed by a newline.\n\n 'write' -- pass an arbitrary string to the gnuplot program.\n\n 'flush' -- cause pending output to be written immediately.\n\n 'close' -- close the connection to gnuplot.\n\n ", '__init__': <function GnuplotProcess.__init__>, 'close': <function GnuplotProcess.close>, '__del__': <function GnuplotProcess.__del__>, '__call__': <function GnuplotProcess.__call__>, '__dict__': <attribute '__dict__' of 'GnuplotProcess' objects>, '__weakref__': <attribute '__weakref__' of 'GnuplotProcess' objects>})¶
-
__init__
(persist=None, quiet=False)[source]¶ Start a gnuplot process.
Create a ‘GnuplotProcess’ object. This starts a gnuplot program and prepares to write commands to it.
Keyword arguments:
- ‘persist=1’ – start gnuplot with the ‘-persist’ option,
(which leaves the plot window on the screen even after the gnuplot program ends, and creates a new plot window each time the terminal type is set to ‘x11’). This option is not available on older versions of gnuplot.
-
__module__
= 'PyFoam.ThirdParty.Gnuplot.gp_unix'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
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.