3 grap \- pic preprocessor for drawing graphs
13 preprocessor for drawing graphs on a typesetter.
14 Graphs are surrounded by the
20 Data are scaled and plotted,
21 with tick marks supplied automatically.
22 Commands exist to modify the frame,
23 add labels, override the default ticks,
24 change the plotting style,
25 define coordinate ranges and transformations,
26 and include data from files.
29 provides the same loops, conditionals, and macro processing that
41 Set the frame around the graph to specified
45 default is 2 by 3 (inches).
59 of the frame can be set
65 .B \&"as a set of strings"
67 Place label on specified side; default side is bottom.
76 to shift default position;
79 sets the width explicitly.
85 .IR "optname expr, expr, ..." :
94 is followed by "...", label tick with "...",
95 and turn off all automatic labels.
98 they will be interpreted as
100 formatting instructions for the tick value.
106 Tick iterator: instead of
120 for additive or multiplicative steps.
122 can be omitted, to give steps of size 1.
123 If no ticks are requested, they are supplied automatically;
127 Automatic ticks normally
128 leave a margin of 7% on each side; set this to anything by
136 .IR "optname expr, expr, ..." :
137 Draw grids perpendicular to
143 Iterators and labels work as with ticks.
153 Set range of coords and optional log scaling on either or both.
154 This overrides computation of data range.
157 is current coordinate system
160 defines a new coordinate system).
174 Text position can be qualified with
185 .IR "point linedesc" :
186 Draw line from here to there.
194 .IR "point linedesc" :
195 Continue plot of data in
201 .IR "optname linedesc ..." :
204 use this style from now on,
205 and plot "..." at each point (if given).
208 .IR "optname linedesc ..." :
211 but disconnect from previous.
231 Abscissae of 1,2,3,... are provided if there is only one input number per line.
235 .I "optname expr, expr
236 maps the point to the named coordinate system.
244 optionally followed by an expression.
248 .BI { whatever } \f1:
250 There are macros already defined for standard plotting
257 .BR /sys/lib/grap.defines ,
258 which is included if it exists.
263 Evaluate an expression.
280 returns random number on [0,1);
289 As a debugging aid, print
293 on the standard error.
296 \fL"\fIfile name\fL"\fR:
297 Include this file right here.
302 Pass rest of input (until
306 treating each field (non-blank, or "...") as an argument.
308 can be the name of a macro previously defined,
309 or the body of one in place, like
310 .BR "/plot $1 at $2,$3/" .
316 \fL"\fIstring\fL"\fR:
317 Stop copy when input is
322 .IR "remainder of line" :
323 Copy to output with leading blanks removed.
326 .IR "Name pic-position" :
327 Start a new frame, place it at specified position,
331 .BR "with .sw at Thing1.se + (0.1,0)" .
333 must be capitalized to keep
337 .BI \&. "anything at beginning of
344 Pass everything between the
349 may be any character and
351 may include newlines.
355 A comment, which is discarded.
357 Order is mostly irrelevant; no category is mandatory.
360 line are placed on the generated
369 frame ht 1 top invis right invis
370 coord x 0, 10 y 1, 3 log y
371 ticks left in at 1 "bottommost tick", 2,3 "top tick"
372 ticks bot in from 0 to 10 by 2
373 label bot "silly graph"
374 label left "left side label" "here"
375 grid left dashed at 2.5
376 copy thru / circle at $1,$2 /
384 frame ht 1 top invis right invis
385 coord x 0, 10 y 1, 3 log y
386 ticks left in at 1 "bottommost tick", 2,3 "top tick"
387 ticks bot in from 0 to 10 by 2
388 label bot "silly graph"
389 label left "left side label" "here"
390 grid left dashed at 2.5
391 copy thru / circle at $1,$2 /
402 .TF /sys/lib/grap.defines
404 .B /sys/lib/grap.defines
405 definitions of standard plotting characters, e.g., bullet
412 J. L. Bentley and B. W. Kernighan,
413 ``GRAP\(emA Language for Typesetting Graphs'',
415 Unix Research System Programmer's Manual,
416 Tenth Edition, Volume 2.