graph(1g)
Name
graph − draw a graph
Syntax
graph [option...]
Description
The graph command with no options takes pairs of numbers from the standard input as abscissas and ordinates of a graph. Successive points are connected by straight lines. The graph is encoded on the standard output for display by the plot() filters.
If the coordinates of a point are followed by a nonnumeric string, that string is printed as a label beginning on the point. Labels may be surrounded with quotes "...", in which case they may be empty or contain blanks and numbers; labels never contain new lines.
A legend indicating grid range is produced with a grid unless the −s option is present.
If a specified lower limit exceeds the upper limit, the axis is reversed.
Options
−aSupplies abscissas automatically and uses next two arguments to set spacing and starting point. Spacing is given by the next argument (default 1). A second optional argument is the starting point for automatic abscissas (default 0 or lower limit given by −x).
−bBreaks graph after each label in the input.
−cUses specified string (next argument) as label.
−gUses specified number (next argument) in setting up grid style: 0 (no grid), 1 (frame with ticks), and 2 (full grid). Default is 2.
−hUses specified number (next argument) as fraction of space for height.
−lUses specified string (next argument) as graph label.
−mUses specified number (next argument) in setting up line mode: 0 (disconnected) and 1 (connected). Default is 1.
−rUses specified number (next argument) as fraction of space to right before plotting.
−sSaves screen (no erase) before plotting.
−tTransposes vertical and horizontal axes.
−uUses specified number (next argument) as fraction of space to move up before plotting.
−wUses specified number (next argument) as fraction of space for width.
−x [ l ]Determines x axis logarithmically. Next two arguments after l determine lower and upper x limits respectively. The third argument determines grid spacing on x axis.
−y [ l ]Same as x but for y axis.
Restrictions
The graph command stores all points internally and drops those for which there is not room. Segments that run out of bounds are dropped, not windowed. Logarithmic axes may not be reversed.