The simplest way to start PyXPlot is simply to type “pyxplot” at a shell prompt to start an interactive session. A PyXPlot command-line prompt will appear, into which commands can be typed. PyXPlot can be exited either by typing “exit”, “quit”, or by pressing CTRL-D.
Alternatively, a list of commands to be executed may be stored in a command script, and executed by passing the filename of the command script to PyXPlot on the shell command line, for example:
pyxplot foo
In this case, PyXPlot would exit immediately after finishing executing the commands from the file foo. Several filenames may be passed on the command line, to be executed in sequence:
pyxplot foo1 foo2 foo3
Wildcards can also be used; the following would execute all command scripts in the presenting working directory whose filenames end with a .plot suffix:
pyxplot *.plot
It is possible to use PyXPlot both interactively, and from command scripts, in the same session. One way to do this is to pass the magic filename ‘–’ on the command line:
pyxplot foo1 - foo2
This magic filename represents an interactive session, which commences after the execution of foo1, and should be terminated in the usual way after use, with the “exit” or “quit” commands. Afterwards, the command script foo2 would execute.
From within an interactive session, it is possible to run a command script using the load command:
pyxplot> load 'foo'
This example would have the same effect as typing the contents of the file foo into the present session.
A related command is “save”, which stores a history of the commands executed in the present interactive session to file.
All command files can include comment lines, which should begin with a hash character, for example:
# This is a comment
Long commands may be split over multiple lines in the script by terminating each line of it with a backslash character, whereupon the following line will be appended to the end of it.