3.1 Getting started
The simplest way to start Pyxplot is to type pyxplot at a shell prompt. This starts an interactive session, and produces a Pyxplot command-line prompt into which commands can be typed. Pyxplot can be exited either by typing exit, quit, or by pressing CTRL-D. Various switches can be specified on the shell command line to modify Pyxplot’s behaviour; these are listed in Box 3.1. Of particular interest may be the switches -c and -m, which change between the use of color-highlighted (default) and non-colored text.
Typing commands into interactive terminals is likely to be a sufficient way for a beginner to drive Pyxplot, but as tasks grow more complicated, more commands are needed to set up plots. It is likely to become preferable to store these commands in text files called scripts. Once such a script has been written, it can be executed automatically by passing the filename of the command script to Pyxplot on the shell command line, for example:
In this case, Pyxplot executes the commands in the file foo.ppl and then exits. By convention, we affix the suffix .ppl to the filenames of all Pyxplot command scripts. This is not strictly necessary, but it allows Pyxplot scripts to be easily distinguished from other text files in a filing system. The filenames of several command scripts may be passed to Pyxplot on a single command line, indicating that they should be executed in sequence, as in the example:
pyxplot foo1.ppl foo2.ppl foo3.ppl
It is also possible to have a single Pyxplot session alternate between running command scripts autonomously and allowing the user to enter commands interactively. There are two ways of doing this. Pyxplot can be passed the magic filename – on the command line, as in the example
pyxplot foo1.ppl -- foo2.ppl
where the – represents an interactive session which commences after the execution of foo1.ppl and should be terminated by the user in the usual way, using either the exit or quit commands. After the interactive session is finished, Pyxplot will automatically execute the command script foo2.ppl.
pyxplot> load ’foo.ppl’
This example would have the same effect as typing the contents of the file foo.ppl into the present interactive terminal.