ECG Database Applications Guide Table of Contents


pschart - produce annotated `chart recordings' on a PostScript device


pschart [ [ options ... ] script ... ]


pschart produces high-quality annotated plots of ECG database records on PostScript devices. When rendered on a PostScript laser printer or phototypesetter, the plots closely resemble those that appear on pages 99-177 of the MIT-BIH Arrhythmia Database Directory.

pschart reads one or more script files containing newline-terminated commands. Its standard output is a PostScript file suitable for printing directly with no further processing. By default, pschart draws `zero-width' lines; doing so typically reduces the printing time by a factor of three for a laser printer while producing visually pleasing results. If the output is destined for a phototypesetter, however, be sure to use the -d option (see below), or the traces and grid will be invisible (or nearly so).


-a ann
Print annotations from annotator ann (default: `atruth'). To suppress annotation printing, use `-a ""'.
-A ann
As for -a, but for a second annotator. The second set of annotations is shown below the first set.
-b n
Set the binding offset to n millimeters (default: 0). The inside margin is increased by n mm, and the outside margin is decreased by the same amount.
-c string
Print `Copyright string' in the left page footer; string may include whitespace if it is quoted. The characters `%d', if included in string, are replaced by the current year. A default copyright notice is printed if no -c option is specified. To suppress printing the copyright notice, use `-c ""'.
-d n
Set up for using a printer with a resolution of n dots per inch (default: n = 300, the typical resolution for laser printers). For a phototypesetter, n is typically 1200 or 2400. Note that n does not have to be correct in order to get properly scaled output; the value determines the granularity of the calculations made by pschart and the line width used by the printer, but not the scales.
Process even-numbered pages in a manner appropriate for two-sided printing. Even-numbered pages are printed with reversed page headers, and with the outside margin on the left (default: page headers are not reversed, and the inside margin is always on the left).
Generate EPSF format (encapsulated PostScript file format), suitable for inclusion in another PostScript file.
Print a 0.5 mV x 0.2 sec grid under each strip (default: no grid).
Print a usage summary.
Read the signal files in high-resolution mode (default: standard mode). These modes are identical for ordinary records. For multifrequency records, the standard decimation of oversampled signals to the frame rate is suppressed in high-resolution mode (rather, all other signals are resampled at the highest sampling frequency).
Label the signals in the margins next to each strip (default: no signal labels).
Print in landscape orientation (default: portrait orientation).
-m inside outside top bottom
Specify page margins in millimeters. Defaults: top and bottom, 25 mm; inside and outside, 25-37.5 mm (half of the difference between the page width and the default strip width). The default strip width is the largest multiple of 25 mm that is at least 50 mm less than the page width. Note that page headers and footers, time stamps, and signal labels are printed in the margins. Also note that hardware-enforced, printer-specific margins are not included; the margins specified using -m apply to the imageable area, and not necessarily to the physical page.
Print marker bars across the signals to show the locations of beat annotations (equivalent to -M1).
Set marker bar and annotation format (note: no space between -M and barstyle). Legal values for barstyle: 0 (no bars); 1 (bars across all signals); 2 (bars across attached signal, annotations at center); 3 (bars across attached signal, annotations above bars). Default: barstyle = 0.
-n n
Use n as the number of the first page (default: 1). Use `-n 0' (or any negative value for n) to suppress page numbering.
Pack sufficiently short strips side-by-side (default: print each strip centered between the inside and outside margins in a row by itself).
-P pagesize
Specify the size of the output pages to be printed. Legal values for pagesize are: `letter' (8.5" x 11", 216 mm x 279 mm; imageable area 209 mm x 272 mm), `lwletter' (8.5" x 11", 216 mm x 279 mm; imageable area 203 mm x 277 mm), `legal' (8.5" x 14", 216 mm x 356 mm; imageable area 209 mm x 348 mm), `legal13' (8.5" x 13", 216 x 330 mm; imageable area 209 mm x 322 mm), `A4' (8.27" x 11.69", 210 mm x 297 mm; imageable area 202 mm x 289 mm), `A5' (5.84" x 8.27", 148 mm x 210 mm; imageable area 140 mm x 202 mm); `B4' (9.84" x 13.9", 250 mm x 353 mm; imageable area 249 mm x 356 mm), `B5' (6.93" x 9.84", 176 mm x 250 mm; imageable area 173 mm x 249 mm), or `widthxheight' (where width and height are the width and height of the imageable area in millimeters). `lwletter' is the standard letter size for the Apple LaserWriter; all of the other predefined page sizes are those used by the Sun SPARCprinter. Note that some printers may require non-standard PostScript code to select non-standard page sizes; in such cases, it may be necessary to customize the prolog file (see FILES). Default: letter size.
Print ``Record xxx'' as the first part of the title of each strip, where xxx is the record name.
Print a record name as part of the header on each page. If strips from two or more records are printed on one page, the name of the last record is printed.
-s signal-list
Print only the signals named in the signal-list (one or more signal numbers, separated by spaces; default: print all signals).
-S scale-mode timestamp-mode
Print scales and timestamps in the specified modes. Legal values for scale-mode: 0 (no scales); 1 (mm/unit in footers); 2 (units/tick in footers); 3 (mm/unit above strips); 4 (units/tick above strips); 5 (mm/unit within strips); 6 (units/tick within strips). Legal values for timestamp-mode: 0 (no timestamps); 1 (elapsed times only); 2 (absolute times if defined, elapsed times otherwise). Defaults: scale-mode = 1, timestamp-mode = 2.
-t n
Set the time scale to n millimeters per second (default: n = 12.5, half of the standard scale for chart recorders).
-T title
Set the page title to title (which may include whitespace if quoted). If no -T option is specified, the page title is constructed from the date of the last recording on the page, if defined, or today's date otherwise. To suppress printing the page title, use `-T ""'.
Generate `unstructured' PostScript as a workaround for a bug in the Adobe TranScript software (also see ENVIRONMENT below). Default: generate structured PostScript, suitable for processing by page-selection or page-reversal post-processors.
-v n
Set the voltage (ordinate) scale to n millimeters per millivolt. Signals that do not have units of millivolts (as specified in the record's header file) are scaled proportionately, as specified by the calibration file (see dbcal(5) ). The default scale is 5 mm/mV, half of the standard scale for chart recorders.
Verbose mode (echo each command as it is read from the script file).
Print only the first character of each comment annotation.


Any argument that is not an option or an option argument is taken as the name of a script of newline-terminated commands to be executed by pschart. If the script name is `-', pschart reads commands from the standard input. Options that follow a script name are not applied to the processing of that script, so it is possible to use two or more scripts with different sets of options in a single run. Standard commands are of the following form:
   record time title
in which record is the name of the record for which a strip is to be printed, time indicates the time of the left edge of the strip to be printed, and title is a description to be printed above the strip. Fields are separated by spaces or tabs. If the time field contains a hyphen (`-'), the portion that precedes the hyphen is taken as the time of the left edge of the strip, and the portion that follows the hyphen indicates the end of the desired segment; additional strips continuous with the first are printed if necessary. Unless the -p option is specified, strips that are less than the full width of the page are centered within the margins. The title field may include embedded spaces or tabs, or it may be omitted. A totally empty command line specifies a page break, i.e., it causes pschart to put the next strip at the top of a new page, even if the current page is not full.


The environment variable PSCHARTPRO can be used to name an alternate prolog file (see below) for custom formats. The environment variable TRANSCRIPTBUG may be set (to any value) to generate `unstructured' PostScript by default (see the -u option above). The environment variables DB and DBCAL should be set and exported (see setdb(1) ).


default PostScript prolog file.


High quality takes time. A full page, with grids and default scales, typically takes about 3 minutes to render on an Apple LaserWriter, or about 6 minutes on a Linotronic 1200 dpi phototypesetter. A SPARCprinter attached to a Sparc IPC or equivalent can render pschart output at nearly full speed (about 28 seconds for the first page, 8 seconds for each subsequent page).

If the record you wish to plot is sampled at a very high rate relative to the printer resolution (i.e., if one sample interval would appear on the page as much less than the distance between pixels), you may wish to use xform(1) to decimate to a lower frequency for efficiency's sake. In extreme cases, this may be necessary to avoid running out of memory in your PostScript printer.

Specifying EPSF output using the -E option does not prevent pschart from producing multi-page output, which is not permitted in EPSF. You should make sure that your output fits entirely onto one page (most easily verified using the -V option) before including it in another document. Note that the bounding box calculated by pschart covers the entire width of the page and most of its height (excluding only about half of the top and bottom margins, so that the header and footer material is included), even if only a small portion of the page contains plots. If you wish to fit such a plot into another document with a minimum of empty space around it, you may either edit the bounding box comment in the pschart output, or specify a page size that closely matches the size of your plot. The document in which pschart output is included can arbitrarily rescale the plot, so that scales expressed in mm/unit cannot be relied upon.

Under MS-DOS, a bug in COMMAND.COM makes it impossible to pass an empty string in the argument list of a command, so that -a "", -c "", and -T "" do not work as described above. Type a space between the quotation marks to avoid this bug, or use one of the UNIX shells that have been ported to MS-DOS instead of COMMAND.COM.

There are too many options. Invoke pschart with no arguments for a brief summary of options.


dbplot(1) , dbtool(1) , psfd(1) , setdb(1) , view(1) , wave(1) , xform(1)

Table of Contents