|Next: PLOTSTM(1) Up: WFDB Applications Guide Previous: PARSESCP(1)||On This Page|
These UNIX shell scripts can be used to produce simple 2-D and 3-D plots using gnuplot(1) in batch (non-interactive) mode. plot2d was designed as a quick-and-dirty replacement for plt(1) (see http://www.physionet.org/physiotools/plt/ ). plot2d accepts a few of the most commonly-used plt options and produces similar plots. plot3d uses the same syntax as plot2d, but it produces simple 3-D plots (a capability not yet offered by plt).
The input-file should contain one or more space- or tab-separated columns of data per line, with each point on a line. Omit the input-file argument to read data from the standard input. (Note: since gnuplot cannot read data from a pipe, plot2d and plot3d save piped input in a temporary file before invoking gnuplot.)
xcol, ycol, and zcol specify the column numbers within the input file for the x, y, and z coordinates of the points to be plotted. The leftmost column is column 0 (this convention follows that used by plt, rather than that used by gnuplot). Omit the xcol argument to plot2d to use row numbers as abscissas; if ycol is also omitted, plot2d plots column 1 vs. column 0. When using plot3d, omit both xcol and ycol to generate x and y coordinates sequentially based on row numbers; a blank line in the input resets x and increments y in this case.
a text file with the following contents:
0 0 0
1 1 1
2 4 8
3 9 27
4 16 64
and call the file powers. Plot the first column vs. the second by:
plot2d powers 0 1 -t "Squares of small integers" -x "Integer" -y "Square"
The same file can be used to generate a number of different plots, by choosing different columns. To plot the third column vs. the first, try: plot2d powers 2 0 -t "Marshmallows" -x "Mass (kg)" -y "Height (m)"
Table of Contents
Up: WFDB Applications Guide
Please e-mail your comments and suggestions to email@example.com, or post them to:PhysioNet
Updated 28 May 2015