xref: /original-bsd/usr.bin/graph/graph.1 (revision c3e32dec)
1.\" Copyright (c) 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.proprietary.roff%
5.\"
6.\"	@(#)graph.1	8.1 (Berkeley) 06/06/93
7.\"
8.Dd
9.Dt GRAPH 1
10.Os ATT 7th
11.Sh NAME
12.Nm graph
13.Nd draw a graph
14.Sh SYNOPSIS
15.Nm graph
16.Op option
17.Ar ...
18.Sh DESCRIPTION
19.Nm Graph
20with no options takes pairs of numbers from the
21standard input as abscissas and
22ordinates of a graph.
23Successive points are connected by straight lines.
24The graph is encoded on the standard output
25for display by the
26.Xr plot 1
27filters.
28.Pp
29If the coordinates of a point are followed by
30a nonnumeric string, that string is printed as a
31label beginning on the point.
32Labels may be surrounded with quotes "...", in
33which case they may be empty or contain blanks
34and numbers;
35labels never contain newlines.
36.Pp
37The following options are recognized,
38each as a separate argument.
39.Bl -tag -width flagx
40.It Fl a
41Supply abscissas automatically (they are missing from
42the input); spacing is given by the next
43argument (default 1).
44A second optional argument is the starting point for
45automatic abscissas (default 0 or lower limit given by
46.Fl x ) .
47.It Fl b
48Break (disconnect) the graph after each label in the input.
49.It Fl c
50Character string given by next argument
51is default label for each point.
52.It Fl g
53Next argument is grid style,
540 no grid, 1 frame with ticks, 2 full grid (default).
55.It Fl l
56Next argument is label for graph.
57.It Fl m
58Next argument is mode (style)
59of connecting lines:
600 disconnected, 1 connected (default).
61Some devices give distinguishable line styles
62for other small integers.
63.It Fl s
64Save screen, don't erase before plotting.
65.It Fl x Ns Op Ar l
66If
67.Ar l
68is present, x axis is logarithmic.
69Next 1 (or 2) arguments are lower (and upper)
70.Ar x
71limits.
72Third argument, if present, is grid spacing on
73.Ar x
74axis.
75Normally these quantities are determined automatically.
76.It Fl y Ns Op Ar l
77Similarly for
78.Ar y  .
79.It Fl h
80Next argument is fraction of space for height.
81.It Fl w
82Similarly for width.
83.It Fl r
84Next argument is fraction of space to move right before plotting.
85.It Fl u
86Similarly to move up before plotting.
87.It Fl t
88Transpose horizontal and vertical axes.
89(Option
90.Fl x
91now applies to the vertical axis.)
92.El
93.Pp
94A legend indicating grid range is produced
95with a grid unless the
96.Fl s
97option is present.
98.Pp
99If a specified lower limit exceeds the upper limit,
100the axis
101is reversed.
102.Sh SEE ALSO
103.Xr spline 1 ,
104.Xr plot 1
105.Sh HISTORY
106The
107.Nm graph
108command appeared in
109.At v6 .
110.Sh BUGS
111.Nm Graph
112stores all points internally and drops those for which
113there isn't room.
114.Pp
115Segments that run out of bounds are dropped, not windowed.
116.Pp
117Logarithmic axes may not be reversed.
118