Go to the first, previous, next, last section, table of contents.

# `graph` Examples

## The format of input to `graph`

`graph` reads in ascii data. Most often, the data is in the form of pairs of x and y values:

    0.0  0.0
    1.0  0.2
    2.0  0.0
    3.0  0.4
    4.0  0.2
    5.0  0.6

You can add labels to specific data points by appending a string after the y coordinate. The label ends at the end of the line:

    3.0  0.4 this is a label for point (3.0, 0.4).

Using the ``-b'` option, you can put more than one data set in the input as long as each is monotonic in x values and decreases from the end of one set to the start of the next:

    0.0  0.0 first data set
    2.0  0.0
    4.0  0.2
    0.0  0.1 second data set
    2.0  0.2
    4.0  0.3

If your data contains only y values which are equally sampled along the x axis, you can use the ``-a'` option to specify the x axis values implicitly.

    0.0
    0.1
    0.2 label for point (2.0, 0.2)
    0.3
    0.2
    0.3

## How to put multiple plots on one page

The command

    graph -h .4 -w .4 -r .1 -u .1 < ascii_data_file_1 >  plot_file

will put a single box containing the plot in the lower left hand quarter of the page. You can add another plot to the upper left hand corner of the page using the command

    graph -h .4 -w .4 -r .1 -u .6 < ascii_data_file_2 >> plot_file

Likewise you can add plots to the right hand side of the page using

    graph -h .4 -w .4 -r .6 -u .1 < ascii_data_file_3 >> plot_file
    graph -h .4 -w .4 -r .6 -u .6 < ascii_data_file_4 >> plot_file

The tick marks can be moved inside the box and labels moved to the opposite sides using

    graph -T -.005 -x T -y L < ascii_data_file >> plot_file

## The `plot2ps` Utility

`plot2ps` is a utility for converting Unix plot files into postscript. The `plot2ps` utility reads plotting commands from named files or the standard input and writes postscript to the standard output. You can then print the postscript output on a printer, or edit it using the `idraw` graphics editor. You can also easily include the output in LaTeX documents using the `dvi2ps` utility and the LaTeX command `psfig`.

The source code and documentation for `plot2ps` and a more complete description of this are available via anonymous ftp from qed.rice.edu (128.42.4.38) in the directory ``/pub'`.

Go to the first, previous, next, last section, table of contents.