1 dfc67f9b 2004-05-16 devnull .TH GRAP 1
3 dfc67f9b 2004-05-16 devnull grap \- pic preprocessor for drawing graphs
4 dfc67f9b 2004-05-16 devnull .SH SYNOPSIS
7 dfc67f9b 2004-05-16 devnull .I file ...
9 dfc67f9b 2004-05-16 devnull .SH DESCRIPTION
12 dfc67f9b 2004-05-16 devnull .IR pic (1)
13 dfc67f9b 2004-05-16 devnull preprocessor for drawing graphs on a typesetter.
14 dfc67f9b 2004-05-16 devnull Graphs are surrounded by the
16 dfc67f9b 2004-05-16 devnull `commands'
19 dfc67f9b 2004-05-16 devnull .BR \&.G2 .
20 dfc67f9b 2004-05-16 devnull Data are scaled and plotted,
21 dfc67f9b 2004-05-16 devnull with tick marks supplied automatically.
22 dfc67f9b 2004-05-16 devnull Commands exist to modify the frame,
23 dfc67f9b 2004-05-16 devnull add labels, override the default ticks,
24 dfc67f9b 2004-05-16 devnull change the plotting style,
25 dfc67f9b 2004-05-16 devnull define coordinate ranges and transformations,
26 dfc67f9b 2004-05-16 devnull and include data from files.
27 dfc67f9b 2004-05-16 devnull In addition,
29 dfc67f9b 2004-05-16 devnull provides the same loops, conditionals, and macro processing that
33 dfc67f9b 2004-05-16 devnull .BI frame
39 dfc67f9b 2004-05-16 devnull .B dotted
40 dfc67f9b 2004-05-16 devnull .IR ... :
41 dfc67f9b 2004-05-16 devnull Set the frame around the graph to specified
44 dfc67f9b 2004-05-16 devnull .BR wid ;
45 dfc67f9b 2004-05-16 devnull default is 2 by 3 (inches).
47 dfc67f9b 2004-05-16 devnull .I styles
48 dfc67f9b 2004-05-16 devnull .RB ( dotted ,
49 dfc67f9b 2004-05-16 devnull .BR dashed ,
50 dfc67f9b 2004-05-16 devnull .BR invis ,
51 dfc67f9b 2004-05-16 devnull .BR solid
52 dfc67f9b 2004-05-16 devnull (default))
55 dfc67f9b 2004-05-16 devnull .RB ( top ,
56 dfc67f9b 2004-05-16 devnull .BR bot ,
57 dfc67f9b 2004-05-16 devnull .BR left ,
58 dfc67f9b 2004-05-16 devnull .BR right )
59 dfc67f9b 2004-05-16 devnull of the frame can be set
60 dfc67f9b 2004-05-16 devnull independently.
64 dfc67f9b 2004-05-16 devnull .B \&"a label"
65 dfc67f9b 2004-05-16 devnull .B \&"as a set of strings"
66 dfc67f9b 2004-05-16 devnull .IR adjust :
67 dfc67f9b 2004-05-16 devnull Place label on specified side; default side is bottom.
68 dfc67f9b 2004-05-16 devnull .I adjust
74 dfc67f9b 2004-05-16 devnull .BR right )
76 dfc67f9b 2004-05-16 devnull to shift default position;
79 dfc67f9b 2004-05-16 devnull sets the width explicitly.
81 dfc67f9b 2004-05-16 devnull .BI ticks
85 dfc67f9b 2004-05-16 devnull .IR "optname expr, expr, ..." :
86 dfc67f9b 2004-05-16 devnull Put ticks on
89 dfc67f9b 2004-05-16 devnull .I "expr, ...,
90 dfc67f9b 2004-05-16 devnull and label with
91 dfc67f9b 2004-05-16 devnull .I \&"expr"\f1.
94 dfc67f9b 2004-05-16 devnull is followed by "...", label tick with "...",
95 dfc67f9b 2004-05-16 devnull and turn off all automatic labels.
96 dfc67f9b 2004-05-16 devnull If "..." contains
97 dfc67f9b 2004-05-16 devnull .BR %f 's,
98 dfc67f9b 2004-05-16 devnull they will be interpreted as
99 dfc67f9b 2004-05-16 devnull .B printf
100 dfc67f9b 2004-05-16 devnull formatting instructions for the tick value.
101 dfc67f9b 2004-05-16 devnull Ticks point
105 dfc67f9b 2004-05-16 devnull (default out).
106 dfc67f9b 2004-05-16 devnull Tick iterator: instead of
108 dfc67f9b 2004-05-16 devnull .IR \&... ,
110 dfc67f9b 2004-05-16 devnull .BI from
115 dfc67f9b 2004-05-16 devnull .I "op expr
118 dfc67f9b 2004-05-16 devnull is optionally
120 dfc67f9b 2004-05-16 devnull for additive or multiplicative steps.
122 dfc67f9b 2004-05-16 devnull can be omitted, to give steps of size 1.
123 dfc67f9b 2004-05-16 devnull If no ticks are requested, they are supplied automatically;
124 dfc67f9b 2004-05-16 devnull suppress this with
125 dfc67f9b 2004-05-16 devnull .B ticks
126 dfc67f9b 2004-05-16 devnull .BR off .
127 dfc67f9b 2004-05-16 devnull Automatic ticks normally
128 dfc67f9b 2004-05-16 devnull leave a margin of 7% on each side; set this to anything by
129 dfc67f9b 2004-05-16 devnull .B margin
131 dfc67f9b 2004-05-16 devnull .IR expr .
134 dfc67f9b 2004-05-16 devnull .I "side linedesc"
136 dfc67f9b 2004-05-16 devnull .IR "optname expr, expr, ..." :
137 dfc67f9b 2004-05-16 devnull Draw grids perpendicular to
139 dfc67f9b 2004-05-16 devnull in style
140 dfc67f9b 2004-05-16 devnull .I linedesc
142 dfc67f9b 2004-05-16 devnull .I "expr, ....\&
143 dfc67f9b 2004-05-16 devnull Iterators and labels work as with ticks.
145 dfc67f9b 2004-05-16 devnull .B coord
146 dfc67f9b 2004-05-16 devnull .I optname
148 dfc67f9b 2004-05-16 devnull .I "min, max"
150 dfc67f9b 2004-05-16 devnull .I "min, max"
151 dfc67f9b 2004-05-16 devnull .B "log x
152 dfc67f9b 2004-05-16 devnull .BR " log y" :
153 dfc67f9b 2004-05-16 devnull Set range of coords and optional log scaling on either or both.
154 dfc67f9b 2004-05-16 devnull This overrides computation of data range.
155 dfc67f9b 2004-05-16 devnull Default value of
156 dfc67f9b 2004-05-16 devnull .I optname
157 dfc67f9b 2004-05-16 devnull is current coordinate system
159 dfc67f9b 2004-05-16 devnull .B coord
160 dfc67f9b 2004-05-16 devnull defines a new coordinate system).
163 dfc67f9b 2004-05-16 devnull .I \&"str"
165 dfc67f9b 2004-05-16 devnull .IR point ;
167 dfc67f9b 2004-05-16 devnull .I \&"str"
169 dfc67f9b 2004-05-16 devnull .IR point :
173 dfc67f9b 2004-05-16 devnull .IR point .
174 dfc67f9b 2004-05-16 devnull Text position can be qualified with
175 dfc67f9b 2004-05-16 devnull .BR rjust ,
176 dfc67f9b 2004-05-16 devnull .BR ljust ,
177 dfc67f9b 2004-05-16 devnull .BR above ,
178 dfc67f9b 2004-05-16 devnull .BR below
179 dfc67f9b 2004-05-16 devnull after "...".
183 dfc67f9b 2004-05-16 devnull .I point
185 dfc67f9b 2004-05-16 devnull .IR "point linedesc" :
186 dfc67f9b 2004-05-16 devnull Draw line from here to there.
187 dfc67f9b 2004-05-16 devnull .B arrow
188 dfc67f9b 2004-05-16 devnull works in place of
189 dfc67f9b 2004-05-16 devnull .BR line .
192 dfc67f9b 2004-05-16 devnull .I optname
194 dfc67f9b 2004-05-16 devnull .IR "point linedesc" :
195 dfc67f9b 2004-05-16 devnull Continue plot of data in
196 dfc67f9b 2004-05-16 devnull .I optname to
197 dfc67f9b 2004-05-16 devnull .IR point ;
198 dfc67f9b 2004-05-16 devnull default is current.
200 dfc67f9b 2004-05-16 devnull .BI draw
201 dfc67f9b 2004-05-16 devnull .IR "optname linedesc ..." :
202 dfc67f9b 2004-05-16 devnull Set mode for
203 dfc67f9b 2004-05-16 devnull .BR next :
204 dfc67f9b 2004-05-16 devnull use this style from now on,
205 dfc67f9b 2004-05-16 devnull and plot "..." at each point (if given).
208 dfc67f9b 2004-05-16 devnull .IR "optname linedesc ..." :
209 dfc67f9b 2004-05-16 devnull Set mode for
210 dfc67f9b 2004-05-16 devnull .BR next ,
211 dfc67f9b 2004-05-16 devnull but disconnect from previous.
213 dfc67f9b 2004-05-16 devnull A list of numbers
214 dfc67f9b 2004-05-16 devnull .I "x y1 y2 y3 ...
215 dfc67f9b 2004-05-16 devnull is treated as
217 dfc67f9b 2004-05-16 devnull .B bullet
219 dfc67f9b 2004-05-16 devnull .IR x,y1 ;
221 dfc67f9b 2004-05-16 devnull .B bullet
223 dfc67f9b 2004-05-16 devnull .IR x,y2 ;
224 dfc67f9b 2004-05-16 devnull etc., or as
228 dfc67f9b 2004-05-16 devnull etc., if
230 dfc67f9b 2004-05-16 devnull is specified.
231 dfc67f9b 2004-05-16 devnull Abscissae of 1,2,3,... are provided if there is only one input number per line.
235 dfc67f9b 2004-05-16 devnull .I "optname expr, expr
236 dfc67f9b 2004-05-16 devnull maps the point to the named coordinate system.
238 dfc67f9b 2004-05-16 devnull .I linedesc
239 dfc67f9b 2004-05-16 devnull is one of
242 dfc67f9b 2004-05-16 devnull .B invis
243 dfc67f9b 2004-05-16 devnull .B solid
244 dfc67f9b 2004-05-16 devnull optionally followed by an expression.
246 dfc67f9b 2004-05-16 devnull .BI define
248 dfc67f9b 2004-05-16 devnull .BI { whatever } \f1:
249 dfc67f9b 2004-05-16 devnull Define a macro.
250 dfc67f9b 2004-05-16 devnull There are macros already defined for standard plotting
251 dfc67f9b 2004-05-16 devnull symbols like
252 dfc67f9b 2004-05-16 devnull .BR bullet ,
253 dfc67f9b 2004-05-16 devnull .BR circle ,
254 dfc67f9b 2004-05-16 devnull .BR star ,
255 dfc67f9b 2004-05-16 devnull .BR plus ,
256 dfc67f9b 2004-05-16 devnull etc., in
257 c8b6342d 2005-01-13 devnull .BR \*9/lib/grap.defines ,
258 dfc67f9b 2004-05-16 devnull which is included if it exists.
262 dfc67f9b 2004-05-16 devnull .IR expr :
263 dfc67f9b 2004-05-16 devnull Evaluate an expression.
264 dfc67f9b 2004-05-16 devnull Operators are
271 dfc67f9b 2004-05-16 devnull Functions are
275 dfc67f9b 2004-05-16 devnull (both base 10),
276 dfc67f9b 2004-05-16 devnull .BR sin ,
277 dfc67f9b 2004-05-16 devnull .BR cos ,
278 dfc67f9b 2004-05-16 devnull .BR sqrt ;
280 dfc67f9b 2004-05-16 devnull returns random number on [0,1);
281 dfc67f9b 2004-05-16 devnull .BI max( e , e )\f1,
282 dfc67f9b 2004-05-16 devnull .BI min( e , e )\f1,
283 dfc67f9b 2004-05-16 devnull .BI int( e )\f1.
285 dfc67f9b 2004-05-16 devnull .B print
286 dfc67f9b 2004-05-16 devnull .IR expr ;
287 dfc67f9b 2004-05-16 devnull .B print
288 dfc67f9b 2004-05-16 devnull \fL"\f2...\fL"\f1:
289 dfc67f9b 2004-05-16 devnull As a debugging aid, print
292 dfc67f9b 2004-05-16 devnull .I string
293 dfc67f9b 2004-05-16 devnull on the standard error.
296 dfc67f9b 2004-05-16 devnull \fL"\fIfile name\fL"\fR:
297 dfc67f9b 2004-05-16 devnull Include this file right here.
301 dfc67f9b 2004-05-16 devnull .IR macro :
302 dfc67f9b 2004-05-16 devnull Pass rest of input (until
303 dfc67f9b 2004-05-16 devnull .BR \&.G2 )
305 dfc67f9b 2004-05-16 devnull .IR macro ,
306 dfc67f9b 2004-05-16 devnull treating each field (non-blank, or "...") as an argument.
307 dfc67f9b 2004-05-16 devnull .I macro
308 dfc67f9b 2004-05-16 devnull can be the name of a macro previously defined,
309 dfc67f9b 2004-05-16 devnull or the body of one in place, like
310 dfc67f9b 2004-05-16 devnull .BR "/plot $1 at $2,$3/" .
314 dfc67f9b 2004-05-16 devnull .I macro
315 dfc67f9b 2004-05-16 devnull .B until
316 dfc67f9b 2004-05-16 devnull \fL"\fIstring\fL"\fR:
317 dfc67f9b 2004-05-16 devnull Stop copy when input is
318 dfc67f9b 2004-05-16 devnull .I string
319 dfc67f9b 2004-05-16 devnull (left-justified).
322 dfc67f9b 2004-05-16 devnull .IR "remainder of line" :
323 dfc67f9b 2004-05-16 devnull Copy to output with leading blanks removed.
325 dfc67f9b 2004-05-16 devnull .BI graph
326 dfc67f9b 2004-05-16 devnull .IR "Name pic-position" :
327 dfc67f9b 2004-05-16 devnull Start a new frame, place it at specified position,
329 dfc67f9b 2004-05-16 devnull .B graph
330 dfc67f9b 2004-05-16 devnull .B Thing2
331 dfc67f9b 2004-05-16 devnull .BR "with .sw at Thing1.se + (0.1,0)" .
333 dfc67f9b 2004-05-16 devnull must be capitalized to keep
337 dfc67f9b 2004-05-16 devnull .BI \&. "anything at beginning of
338 dfc67f9b 2004-05-16 devnull .IR line :
339 dfc67f9b 2004-05-16 devnull Copied verbatim.
342 dfc67f9b 2004-05-16 devnull .BI % anything
344 dfc67f9b 2004-05-16 devnull Pass everything between the
345 dfc67f9b 2004-05-16 devnull .BR % 's
346 dfc67f9b 2004-05-16 devnull to the shell;
347 dfc67f9b 2004-05-16 devnull as with macros,
349 dfc67f9b 2004-05-16 devnull may be any character and
350 dfc67f9b 2004-05-16 devnull .I anything
351 dfc67f9b 2004-05-16 devnull may include newlines.
354 dfc67f9b 2004-05-16 devnull .IR anything :
355 dfc67f9b 2004-05-16 devnull A comment, which is discarded.
357 dfc67f9b 2004-05-16 devnull Order is mostly irrelevant; no category is mandatory.
358 dfc67f9b 2004-05-16 devnull Any arguments on the
359 dfc67f9b 2004-05-16 devnull .B \&.G1
360 dfc67f9b 2004-05-16 devnull line are placed on the generated
361 dfc67f9b 2004-05-16 devnull .B \&.PS
362 dfc67f9b 2004-05-16 devnull line for
363 dfc67f9b 2004-05-16 devnull .IR pic .
364 dfc67f9b 2004-05-16 devnull .SH EXAMPLES
369 dfc67f9b 2004-05-16 devnull frame ht 1 top invis right invis
370 dfc67f9b 2004-05-16 devnull coord x 0, 10 y 1, 3 log y
371 dfc67f9b 2004-05-16 devnull ticks left in at 1 "bottommost tick", 2,3 "top tick"
372 dfc67f9b 2004-05-16 devnull ticks bot in from 0 to 10 by 2
373 dfc67f9b 2004-05-16 devnull label bot "silly graph"
374 dfc67f9b 2004-05-16 devnull label left "left side label" "here"
375 dfc67f9b 2004-05-16 devnull grid left dashed at 2.5
376 dfc67f9b 2004-05-16 devnull copy thru / circle at $1,$2 /
384 dfc67f9b 2004-05-16 devnull frame ht 1 top invis right invis
385 dfc67f9b 2004-05-16 devnull coord x 0, 10 y 1, 3 log y
386 dfc67f9b 2004-05-16 devnull ticks left in at 1 "bottommost tick", 2,3 "top tick"
387 dfc67f9b 2004-05-16 devnull ticks bot in from 0 to 10 by 2
388 dfc67f9b 2004-05-16 devnull label bot "silly graph"
389 dfc67f9b 2004-05-16 devnull label left "left side label" "here"
390 dfc67f9b 2004-05-16 devnull grid left dashed at 2.5
391 dfc67f9b 2004-05-16 devnull copy thru / circle at $1,$2 /
401 dfc67f9b 2004-05-16 devnull .SH FILES
402 c8b6342d 2005-01-13 devnull .TF \*9/lib/grap.defines
404 c8b6342d 2005-01-13 devnull .B \*9/lib/grap.defines
405 dfc67f9b 2004-05-16 devnull definitions of standard plotting characters, e.g., bullet
406 dfc67f9b 2004-05-16 devnull .SH SOURCE
407 c3674de4 2005-01-11 devnull .B \*9/src/cmd/grap
408 dfc67f9b 2004-05-16 devnull .SH "SEE ALSO"
409 dfc67f9b 2004-05-16 devnull .IR pic (1),
410 dfc67f9b 2004-05-16 devnull .IR troff (1)
412 dfc67f9b 2004-05-16 devnull J. L. Bentley and B. W. Kernighan,
413 dfc67f9b 2004-05-16 devnull ``GRAP\(emA Language for Typesetting Graphs'',
415 dfc67f9b 2004-05-16 devnull Unix Research System Programmer's Manual,
416 dfc67f9b 2004-05-16 devnull Tenth Edition, Volume 2.