aboutsummaryrefslogtreecommitdiff
path: root/man/man7/plot.html
blob: ca64b3fd3a60669e9b1d1cfc22cca98658ac03c1 (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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
<head>
<title>plot(7) - Plan 9 from User Space</title>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
</head>
<body bgcolor=#ffffff>
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr height=10><td>
<tr><td width=20><td>
<tr><td width=20><td><b>PLOT(7)</b><td align=right><b>PLOT(7)</b>
<tr><td width=20><td colspan=2>
    <br>
<p><font size=+1><b>NAME     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    plot &ndash; graphics interface<br>
    
</table>
<p><font size=+1><b>DESCRIPTION     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    Files of this format are interpreted by <a href="../man1/plot.html"><i>plot</i>(1)</a> to draw graphics
    on the screen. A <i>plot</i> file is a UTF stream of instruction lines.
    Arguments are delimited by spaces, tabs, or commas. Numbers may
    be floating point. Punctuation marks (except <tt><font size=+1>:</font></tt>) , spaces, and
    tabs at the beginning of lines are ignored. Comments run from
    <tt><font size=+1>:</font></tt> to newline. Extra letters appended to a valid instruction are
    ignored. Thus <tt><font size=+1>...line</font></tt>, <tt><font size=+1>line</font></tt>, <tt><font size=+1>li</font></tt> all mean the same thing. Arguments
    are interpreted as follows:<br>
    1.&nbsp;&nbsp;&nbsp;&nbsp;If an instruction requires no arguments, the rest of the line
    is ignored.<br>
    2.&nbsp;&nbsp;&nbsp;&nbsp;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 <tt><font size=+1>\n</font></tt>.<br>
    3.&nbsp;&nbsp;&nbsp;&nbsp;Between numeric arguments alphabetic characters and punctuation
    marks are ignored. Thus <tt><font size=+1>line from 5 6 to 7 8</font></tt> draws a line from
    (5, 6) to (7, 8).<br>
    4.&nbsp;&nbsp;&nbsp;&nbsp;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).<br>
    
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        <tt><font size=+1>move 4.5 6.77<br>
        vec 5.8, 5.6 7.8<br>
        4.55 10.0, 3.6 4.5, 6.77<br>
        
        <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
        </font></tt>
        
    </table>
    The instructions are executed in order. The last designated point
    in a <tt><font size=+1>line</font></tt>, <tt><font size=+1>move</font></tt>, <tt><font size=+1>rmove</font></tt>, <tt><font size=+1>vec</font></tt>, <tt><font size=+1>rvec</font></tt>, <tt><font size=+1>arc</font></tt>, or <tt><font size=+1>point</font></tt> command becomes
    the &#8216;current point&#8217; (<i>X,Y</i>) for the next command.<br>
    <p><font size=+1><b>Open &amp; Close     </b></font><br>
    <tt><font size=+1>o</font></tt> <i>string</i>&nbsp;&nbsp;&nbsp;Open plotting device. For <i>troff</i>, <i>string</i> specifies the
    size of the plot (default is <tt><font size=+1>6i</font></tt>).<br>
    <tt><font size=+1>cl</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Close plotting device.<br>
    <p><font size=+1><b>Basic Plotting Commands     </b></font><br>
    <tt><font size=+1>e</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start another frame of output.<br>
    <tt><font size=+1>m</font></tt> <i>x y</i>&nbsp;&nbsp;&nbsp;&nbsp;(move) Current point becomes <i>x y.<br>
    </i><tt><font size=+1>rm</font></tt> <i>dx dy</i>Current point becomes <i>X+dx Y+dy.<br>
    </i><tt><font size=+1>poi</font></tt> <i>x y</i>Plot the point <i>x y</i> and make it the current point.<br>
    <tt><font size=+1>v</font></tt> <i>x y</i>&nbsp;&nbsp;&nbsp;&nbsp;Draw a vector from the current point to <i>x y.<br>
    </i><tt><font size=+1>rv</font></tt> <i>dx dy</i>Draw vector from current point to X<i>+</i>dx Y<i>+</i>dy<br>
    <tt><font size=+1>li</font></tt> <i>x1 y1 x2 y2<br>
    </i>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Draw a line from <i>x1 y1</i> to <i>x2 y2.</i> Make the current point <i>x2 y2.<br>
            </i>
        </table>
        
    </table>
    <tt><font size=+1>t</font></tt> <i>string</i>&nbsp;&nbsp;&nbsp;Place the <i>string</i> so that its first character is centered
    on the current point (default). If <i>string</i> begins with <tt><font size=+1>\C</font></tt> (<tt><font size=+1>\R</font></tt>),
    it is centered (right-adjusted) on the current point. A backslash
    at the beginning of the string may be escaped with another backslash.<br>
    <tt><font size=+1>a</font></tt> <i>x1 y1 x2 y2 xc yc r<br>
    </i>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Draw a circular arc from <i>x1 y1</i> to <i>x2 y2</i> with center <i>xc yc</i> and
            radius <i>r</i>. If the radius is positive, the arc is drawn counterclockwise;
            negative, clockwise. The starting point is exact but the ending
            point is approximate.<br>
            
        </table>
        
    </table>
    <tt><font size=+1>ci</font></tt> <i>xc yc r<br>
    </i>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Draw a circle centered at <i>xc yc</i> with radius <i>r</i>. If the range and
            frame parameters do not specify a square, the &#8216;circle&#8217; will be
            elliptical.<br>
            
        </table>
        
    </table>
    <tt><font size=+1>di</font></tt> <i>xc yc r<br>
    </i>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Draw a disc centered at <i>xc yc</i> with radius <i>r</i> using the filling
            color (see <tt><font size=+1>cfill</font></tt> below).<br>
            
        </table>
        
    </table>
    <tt><font size=+1>bo</font></tt> <i>x1 y1 x2 y2<br>
    </i>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Draw a box with lower left corner at <i>x1 y1</i> and upper right corner
            at <i>x2 y2.<br>
            </i>
        </table>
        
    </table>
    <tt><font size=+1>sb</font></tt> <i>x1 y1 x2 y2<br>
    </i>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Draw a solid box with lower left corner at <i>x1 y1</i> and upper right
            corner at <i>x2 y2</i> using the filling color (see <tt><font size=+1>cfill</font></tt> below).<br>
            
        </table>
        
    </table>
    <tt><font size=+1>par</font></tt> <i>x1 y1 x2 y2 xg yg<br>
    </i>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Draw a parabola from <i>x1 y1</i> to <i>x2 y2</i> &#8216;guided&#8217; by <i>xg yg.</i> The parabola
            passes through the midpoint of the line joining <i>xg yg</i> with the
            midpoint of the line joining <i>x1 y1</i> and <i>x2 y2</i> and is tangent to
            the lines from <i>xg yg</i> to the endpoints.<br>
            
        </table>
        
    </table>
    <tt><font size=+1>pol { {</font></tt><i>x1 y1 ... xn yn</i><tt><font size=+1>}</font></tt> <i>...</i> <tt><font size=+1>{</font></tt><i>X1 Y1 ... Xm Ym</i><tt><font size=+1>} }<br>
    </font></tt>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Draw polygons with vertices <i>x1 y1 ... xn yn</i> and <i>X1 Y1 ... Xm Ym.</i>
            If only one polygon is specified, the inner brackets are not needed.<br>
            
        </table>
        
    </table>
    <tt><font size=+1>fi { {</font></tt><i>x1 y1 ... xn yn</i><tt><font size=+1>}</font></tt> <i>...</i> <tt><font size=+1>{</font></tt><i>X1 Y1 ... Xm Ym</i><tt><font size=+1>} }<br>
    </font></tt>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Fill a polygon. The arguments are the same as those for <tt><font size=+1>pol</font></tt> 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.<br>
            
        </table>
        
    </table>
    <tt><font size=+1>sp { {</font></tt><i>x1 y1 ... xn yn</i><tt><font size=+1>}</font></tt> <i>...</i> <tt><font size=+1>{</font></tt><i>X1 Y1 ... Xm Ym</i><tt><font size=+1>} }<br>
    </font></tt>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Draw a parabolic spline guided by <i>x1 y1 ... xn yn</i> with simple
            endpoints.<br>
            
        </table>
        
    </table>
    <tt><font size=+1>fsp { {</font></tt><i>x1 y1 ... xn yn</i><tt><font size=+1>}</font></tt> <i>...</i> <tt><font size=+1>{</font></tt><i>X1 Y1 ... Xm Ym</i><tt><font size=+1>} }<br>
    </font></tt>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Draw a parabolic spline guided by <i>x1 y1 ... xn yn</i> with double
            first endpoint.<br>
            
        </table>
        
    </table>
    <tt><font size=+1>lsp { {</font></tt><i>x1 y1 ... xn yn</i><tt><font size=+1>}</font></tt> <i>...</i> <tt><font size=+1>{</font></tt><i>X1 Y1 ... Xm Ym</i><tt><font size=+1>} }<br>
    </font></tt>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Draw a parabolic spline guided by <i>x1 y1 ... xn yn</i> with double
            last endpoint.<br>
            
        </table>
        
    </table>
    <tt><font size=+1>dsp { {</font></tt><i>x1 y1 ... xn yn</i><tt><font size=+1>}</font></tt> <i>...</i> <tt><font size=+1>{</font></tt><i>X1 Y1 ... Xm Ym</i><tt><font size=+1>} }<br>
    </font></tt>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Draw a parabolic spline guided by <i>x1 y1 ... xn yn</i> with double
            endpoints.<br>
            
        </table>
        
    </table>
    <tt><font size=+1>csp { {</font></tt><i>x1 y1 ... xn yn</i><tt><font size=+1>}</font></tt> <i>...</i> <tt><font size=+1>{</font></tt><i>X1 Y1 ... Xm Ym</i><tt><font size=+1>} }<br>
    in</font></tt> <i>filename<br>
    </i>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            (include) Take commands from <i>filename</i>.<br>
            
        </table>
        
    </table>
    <tt><font size=+1>de</font></tt> <i>string</i> <tt><font size=+1>{</font></tt> <i>commands</i> <tt><font size=+1>}<br>
    </font></tt>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Define <i>string</i> as <i>commands</i>.<br>
            
        </table>
        
    </table>
    <tt><font size=+1>ca</font></tt> <i>string scale<br>
    </i>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Invoke commands defined as <i>string</i> applying <i>scale</i> to all coordinates.<br>
            
        </table>
        
    </table>
    <p><font size=+1><b>Commands Controlling the Environment     </b></font><br>
    <tt><font size=+1>co</font></tt> <i>string<br>
    </i>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Use color given by first character of <i>string</i>, one of <tt><font size=+1>red</font></tt>, <tt><font size=+1>yellow</font></tt>,
            <tt><font size=+1>green</font></tt>, <tt><font size=+1>blue</font></tt>, <tt><font size=+1>cyan</font></tt>, <tt><font size=+1>magenta</font></tt>, <tt><font size=+1>white</font></tt>, and <tt><font size=+1>kblack</font></tt>. If <i>string</i> 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, <tt><font size=+1>0xFFFF00FF</font></tt> denotes
            solid yellow.
            
        </table>
        
    </table>
    <tt><font size=+1>pe</font></tt> <i>string<br>
    </i>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Use <i>string</i> as the style for drawing lines. The available pen styles
            are: <tt><font size=+1>solid</font></tt>, <tt><font size=+1>dott</font></tt>[ed], <tt><font size=+1>short</font></tt>, <tt><font size=+1>long</font></tt>, <tt><font size=+1>dotd</font></tt>[ashed]<tt><font size=+1>, cdash</font></tt>, <tt><font size=+1>ddash<br>
            </font></tt>
        </table>
        
    </table>
    <tt><font size=+1>cf</font></tt> <i>string<br>
    </i>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Color for filling (see <tt><font size=+1>co</font></tt>, above).<br>
            
        </table>
        
    </table>
    <tt><font size=+1>ra</font></tt> <i>x1 y1 x2 y2<br>
    </i>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            The data will fall between <i>x1 y1</i> and <i>x2 y2.</i> The plot will be magnified
            or reduced to fit the device as closely as possible.<br>
            Range settings that exactly fill the plotting area with unity
            scaling appear below for devices supported by the filters of <a href="../man1/plot.html"><i>plot</i>(1)</a>.
            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.
            
        </table>
        
    </table>
    <tt><font size=+1>fr</font></tt> <i>px1 py1 px2 py2<br>
    </i>
    <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

        
        <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

            Plot the data in the fraction of the display specified by <i>px1
            py1</i> for lower left corner and <i>px2 py2</i> for upper right corner.
            Thus <tt><font size=+1>frame .5 0 1. .5</font></tt> plots in the lower right quadrant of the
            display; <tt><font size=+1>frame 0. 1. 1. 0.</font></tt> uses the whole display but inverts
            the <i>y</i> coordinates.<br>
            
        </table>
        
    </table>
    <tt><font size=+1>sa</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Save the current environment, and move to a new one. The new
    environment inherits the old one. There are 7 levels.<br>
    <tt><font size=+1>re</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Restore previous environment.<br>
    
</table>
<p><font size=+1><b>SEE ALSO     </b></font><br>

<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>

    <a href="../man1/plot.html"><i>plot</i>(1)</a>, <a href="../man1/graph.html"><i>graph</i>(1)</a><br>
    
</table>

<td width=20>
<tr height=20><td>
</table>
<!-- TRAILER -->
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr height=15><td width=10><td><td width=10>
<tr><td><td>
<center>
<a href="../../"><img src="../../dist/spaceglenda100.png" alt="Space Glenda" border=1></a>
</center>
</table>
<!-- TRAILER -->
</body></html>