Docs: ERPSS System Tour - Page 6

Plotting and Graphics

The ERP software system includes a number of programs that graphically depict data. Certain aspects of plotting and graphical display are common to all programs; these aspects are discussed in the section entitled "General" below. The subsequent sections briefly describe the application programs that are available, so that one can select additional documentation for a specific purpose. Most of the graphics programs share a common user interface, which is described in plotcmd (E1). It is recommended that you read the plotcmd documentation before using any of the graphics programs.

General

One central principle of ERPSS graphics is that plotting operations require the concurrent operation of two programs, a user-level program that is specific for some function (e.g., plotting ERP waveforms) and outputs device-independent drawing commands, and another that reads these commands and translates them into device-specific actions. This separation allows one to use the same user-level program with different graphics devices, without having to have a different version of the program for each device, or one large program that must anticipate use with a large class of possible output devices. The device-specific program is termed a filter for the device, and is invoked automatically by each application program that employs a graphical display. Each application program generates device-independent commands that are then "piped" to the device-specific filter program, which converts them to appropriate actions for that specific plotting device. Using this approach simplifies the addition of a new graphics device: one needs only to write a filter for the specific device and it can then be used by all programs that plot information, without altering any of those application programs. Since different devices have different capabilities, not all attributes are supported by all devices, but generally something reasonable enough is done by each device to allow images to be displayed.

One specifies a specific plotting (or graphics) device to an application program by supplying a short mnemonic that represents the device. For example, to use the ploterps (E1) program to plot ERP waveforms on the Phaser color printer, one would type "ploterps phaser ...", where "phaser" specifies the printer. To print the same waveforms on a color X-window, one would type "ploterps cxw ...", where "cxw" stands for color X-window. These short names are stored in a system-specific data base named graphicdevs in the /epl/erpss/lib directory. A description of the format of this database is available in graphicdevs (E4), and the basic devices and their names are summarized in plotdevs (E5), but the most up-to-date information on the devices that are available at any installation is best obtained by looking at the graphicdevs file itself. The data base contains information about the device, such as its actual physical resolution, whether it is a raster or pen plotting device, and the filter program that should be invoked to convert the device-independent plotting commands to device-specific instructions. Usually there is also a manual entry for each device for which a filter is available (e.g. phaser (E5) ) which describes the specific device and its characteristics in detail.

Most filters can be invoked in "landscape" mode (the default), in which the abscissa is aligned with the long axis of the drawing surface, or "portrait" mode, in which the ordinate is aligned with the long axis of the drawing surface. The landscape mode is the default, while the portrait mode filters are selected by prepending a "p" to the device name (e.g. pmvc). Most devices have a 4:3 aspect ratio (x to y) in landscape mode, and a 3:4 ratio in portrait mode. In addition, some devices (video raster devices) can be invoked with an "n" prepended to the name, indicating that the screen should not be erased when the device is opened.

Finally, there is also a mechanism that allows one to store images as the device-independent commands that are generated by the application programs. This is accomplished by supplying the word save, followed by a colon, followed by the name of the desired file, without any intervening spaces or tabs (e.g. save:imagefile). These saved image files are used by certain plotting programs (e.g. multiplot (E1) ), or can be directed into a filter as is to generate an image. It is also possible to save the output as an "Encapsulated PostScript" (EPS) file using the "psf" family of plot filters. These files can then be imported into commercial graphics packages, such as CorelDraw.

ploterps

Ploterps (E1) is the mainstay for plotting ERP data. It can be used simply and quickly to plot data in a standardized format, or, in conjunction with a text file containing more detailed formatting information, to generate plots in almost any form imaginable. A well-written, tutorial user's manual is available containing detailed discussions of its use, as well as examples.

Here is a sample of one possible output format from ploterps:

multiplot

Multiplot (E1) is a "cut and paste" program that allows one to combine the output of any ERPSS program(s) that employ graphic devices, scale and rearrange the images, add text and simple geometric figures, and then plot the result on any graphic device desired. Multiplot exploits the save:imagefile pseudo-device mechanism of the ERPSS filtered plotting system. One captures images from the programs that generate the sub-images, and these "saved-image" files are then supplied as input to multiplot, along with scaling and positioning information.

Both a user's manual and manual page are available for multiplot. The user's manual is good, and contains examples; the manual page is best used as a reference on the invocation and options for multiplot. Note that almost all of the multiplot commands are also available in ploterps, bargraf, and linegraf.

sscplot

This program is used to plot iso-voltage contours from multi-channel data files using a spherical spline interpolation algorithm. Current source density maps can also be plotted. Sscplot uses an ASCII text file to specify the contour levels, interpolation grid, recorded data locations, etc. The manual page is quite specific, and should be sufficient to use sscplot (E1).

Here is a sample from sscplot:

Alternatively, you can use the do_maps program to plot multiple contoured heads on a page, with options to normalize across all maps, etc.

bargraf

Bargraf (E1) allows one to create bar graphs in a reasonably flexible manner. It employs an ASCII text file that contains the data to be graphed, as well as formatting information.

Here is a sample from bargraf:

linegraf

Linegraf (E1) allows one to create graphs containing data points connected with lines. Various symbols can be used as markers for the data points, and various types of lines can connect the data points. Linegraf employs an ASCII text file that contains the data to be graphed, as well as formatting information.

Here is a sample from linegraf: