aboutsummaryrefslogtreecommitdiff
path: root/man/man7/plot.7
blob: d4550f51e35b2af5d1eac7ac12c722bb2f7eb334 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
.TH PLOT 7
.SH NAME
plot \- graphics interface
.SH DESCRIPTION
Files of this format are interpreted by
.IR  plot (1)
to draw graphics on the screen.
A
.I plot
file is a
.SM UTF
stream of
instruction lines.
Arguments are delimited by spaces, tabs, or commas.
Numbers may be floating point.
Punctuation marks (except 
.LR : )
,
spaces, and tabs at the beginning of lines are ignored.
Comments run from  
.L :
to newline.
Extra letters appended to a valid instruction are ignored.
Thus
.LR ...line ,
.LR line , and 
.L li
all mean the same thing.
Arguments are interpreted as follows:
.TP
1.
If an instruction requires no arguments, the rest of the line is ignored.
.TP
2.
If it requires a string argument, then all the line
after the first field separator is passed as argument.
Quote marks may be used to preserve leading blanks.
Strings may include newlines represented as
.LR \en .
.TP
3.
Between numeric arguments alphabetic characters and
punctuation marks are ignored.
Thus
.L
line from 5 6 to 7 8
draws a line from (5, 6) to (7, 8).
.TP
4.
Instructions with numeric arguments remain in effect until
a new instruction is read.
Such commands may spill over many lines. Thus
the following sequence will draw a polygon
with vertices
(4.5, 6.77), (5.8, 5.6), (7.8, 4.55), and (10.0, 3.6).
.IP
.EX
move 4.5 6.77
vec 5.8, 5.6 7.8
4.55 10.0, 3.6 4.5, 6.77
.EE
.PP
The instructions are executed in order.
The last designated point in a
.BR line ", " move ", " rmove ,
.BR vec ", " rvec ", " arc ,
or
.B point
command becomes the `current point'
.RI ( X,Y )
for the next command.
.SS "Open & Close"
.PD0
.TP 10
.BI o " string"
Open plotting device.
For 
.IR troff ,
.I string
specifies the size of the plot
(default is
.LR 6i ).
.TP 10
.B cl
Close plotting device.
.PD
.SS "Basic Plotting Commands"
.PD0
.TP 10
.B e
Start another frame of output.
.TP 10
.BI m " x y"
(move) Current point becomes
.I "x y."
.TP 10
.BI rm " dx dy"
Current point becomes
.I "X+dx Y+dy."
.TP 10
.BI poi " x y"
Plot the point
.I "x y"
and make it the current point.
.TP 10
.BI v " x y"
Draw a vector from the current point to
.I "x y."
.TP 10
.BI rv " dx dy"
Draw vector from current point to
.RI X + dx
.RI Y + dy
.TP 10
.BI li " x1 y1 x2 y2"
Draw a line from
.I "x1 y1"
to
.I "x2 y2."
Make the current point
.I "x2 y2."
.TP 10
.BI t " string"
Place the
.I string
so that its
first character is centered on the current point (default).
If
.I string
begins with
.L \eC
.RL ( \eR ),
it is centered (right-adjusted) on the current point.
A backslash at the beginning of the string may
be escaped with another backslash.
.TP 10
.BI a " x1 y1 x2 y2 xc yc r"
Draw a circular arc from
.I "x1 y1"
to
.I "x2 y2"
with center
.I "xc yc"
and radius
.IR r .
If the radius is positive, the arc is drawn counterclockwise;
negative, clockwise.
The starting point is exact but the ending point is approximate.
.TP 10
.BI ci " xc yc r"
Draw a circle centered at
.I "xc yc"
with radius
.IR r .
If the range and frame parameters do not specify a square,
the `circle' will be elliptical.
.TP 10
.BI di " xc yc r"
Draw a disc centered at
.I "xc yc"
with radius
.I r
using the filling color (see 
.B cfill
below).
.TP 10
.BI bo " x1 y1 x2 y2"
Draw a box with lower left corner at
.I "x1 y1"
and upper right corner at
.I "x2 y2."
.TP 10
.BI sb " x1 y1 x2 y2"
Draw a solid box with lower left corner at
.I "x1 y1"
and upper right corner at
.I "x2 y2"
using the filling color (see 
.B cfill
below).
.TP 10
.BI par " x1 y1 x2 y2 xg yg"
Draw a parabola from
.I "x1 y1"
to
.I "x2 y2"
`guided' by
.I "xg yg."
The parabola passes through the midpoint of the line joining
.I "xg yg"
with the midpoint of the line
joining
.I "x1 y1"
and
.I "x2 y2"
and is tangent to the lines from
.I "xg yg"
to the endpoints.
.TP 10
.BI "pol { {" "x1 y1 ... xn yn" } " ... " { "X1 Y1 ... Xm Ym\fP} }\fI"
Draw polygons with vertices
.I "x1 y1 ... xn yn"
and
.I "X1 Y1 ... Xm Ym."
If only one polygon is specified, the inner brackets are
not needed.
.TP 10
.BI "fi { {" "x1 y1 ... xn yn" } " ... " { "X1 Y1 ... Xm Ym\fP} }\fI"
Fill a polygon.
The arguments are the same as those for
.B pol
except that the first vertex is automatically repeated to
close each polygon.
The polygons do not have to be connected.
Enclosed polygons appear as holes.
.TP 10
.BI "sp { {" "x1 y1 ... xn yn" } " ... " { "X1 Y1 ... Xm Ym\fL} }\fI"
Draw a parabolic spline guided by
.I "x1 y1 ... xn yn"
with simple endpoints.
.TP 10
.BI "fsp { {" "x1 y1 ... xn yn" } " ... " { "X1 Y1 ... Xm Ym\fL} }\fI"
Draw a parabolic spline guided by
.I "x1 y1 ... xn yn"
with double first endpoint.
.TP 10
.BI "lsp { {" "x1 y1 ... xn yn" } " ... " { "X1 Y1 ... Xm Ym\fL} }\fI"
Draw a parabolic spline guided by
.I "x1 y1 ... xn yn"
with double last endpoint.
.TP 10
.BI "dsp { {" "x1 y1 ... xn yn" } " ... " { "X1 Y1 ... Xm Ym\fL} }\fI"
Draw a parabolic spline guided by
.I "x1 y1 ... xn yn"
with double endpoints.
.TP 10
.BI "csp { {" "x1 y1 ... xn yn" } " ... " { "X1 Y1 ... Xm Ym\fL} }\fI"
.TP 10
.BI in " filename"
(include) Take commands from
.IR filename .
.TP 10
.BI de " string " { " commands " }
Define
.I string
as
.IR commands .
.TP 10
.BI ca " string scale"
Invoke commands defined as
.I string
applying
.I scale
to all coordinates.
.PD
.SS "Commands Controlling the Environment"
.PD0
.TP 10
.BI co " string"
Use color given by first character of
.IR string ,
one of
.BR red ,
.BR yellow ,
.BR green ,
.BR blue ,
.BR cyan ,
.BR magenta ,
.BR white ,
and
.BR kblack .
If
.I string
begins with a digit, it is taken to be
a 32-bit number specifying 8 bit each of red, green, blue, and alpha.
For example,
.B 0xFFFF00FF
denotes solid yellow.
.TP 10
.BI pe " string"
Use
.I string
as the style for drawing lines.
The available pen styles are:
.BR solid ,
.BR  dott [ed],
.BR short ,
.BR long ,
.BR dotd [ashed] ,
.BR cdash ,
.BR ddash
.TP 10
.BI cf " string"
Color for filling (see
.BR co ,
above).
.TP 10
.BI ra " x1 y1 x2 y2"
The data will fall between
.I "x1 y1"
and
.I "x2 y2."
The plot will be magnified or reduced to fit
the device as closely as possible.
.IP
Range settings that exactly fill the plotting area
with unity scaling appear below for
devices supported by the filters of
.IR  plot (1).
The upper limit is just outside the plotting area.
In every case the plotting area is taken to be square;
points outside may be displayable on
devices with nonsquare faces.
.TP 10
.BI fr " px1 py1 px2 py2"
Plot the data in the fraction of the display
specified by
.I "px1 py1"
for lower left corner
and
.I "px2 py2"
for upper right corner.
Thus  
.L frame .5 0 1. .5
plots in the lower right
quadrant of the display;
.L frame 0. 1. 1. 0.
uses the whole display but
inverts the
.I y
coordinates.
.TP 10
.B sa
Save the current environment, and move to a new one.
The new environment inherits the old one.
There are 7 levels.
.TP 10
.B re
Restore previous environment.
.PD
.SH "SEE ALSO"
.IR plot (1), 
.IR graph (1)