Download PLAN 9 from BELL LABS PROGRAMMER`S

Transcript
GRAP ( 1 )
GRAP ( 1 )
copy "file name": Include this file right here.
copy thru macro: Pass rest of input (until .G2) through macro, treating each field (non-blank, or "...")
as an argument. macro can be the name of a macro previously defined, or the body of one in place, like
/plot $1 at $2,$3/.
copy thru macro until "string": Stop copy when input is string (left-justified).
pic remainder of line: Copy to output with leading blanks removed.
graph Name pic-position: Start a new frame, place it at specified position, e.g., graph Thing2 with
.sw at Thing1.se + (0.1,0). Name must be capitalized to keep pic happy.
.anything at beginning of line: Copied verbatim.
sh %anything %: Pass everything between the %’s to the shell; as with macros, % may be any character and
anything may include newlines.
# anything: A comment, which is discarded.
Order is mostly irrelevant; no category is mandatory. Any arguments on the .G1 line are placed on the
generated .PS line for pic.
E
EX
XA
AM
MP
PL
LE
ES
S
.G1
frame ht 1 top invis right invis
coord x 0, 10 y 1, 3 log y
ticks left in at 1 "bottommost tick", 2,3 "top tick"
ticks bot in from 0 to 10 by 2
label bot "silly graph"
label left "left side label" "here"
grid left dashed at 2.5
copy thru / circle at $1,$2 /
1 1
2 1.5
3 2
4 1.5
10 3
.G2
( .,. )... 0.000i 1.583i 4.700i 0.000i
top tick
left side label
here
bottommost tick
0
2
4
6
8
10
silly graph
F
FIIL
LE
ES
S
/sys/lib/grap.defines
definitions of standard plotting characters, e.g., bullet
S
SE
EE
EA
AL
LS
SO
O
pic(1), troff(1)
J. L. Bentley and B. W. Kernighan, ‘GRAP—A Language for Typesetting Graphs’, Unix Research System
Programmer’s Manual, Volume 2
January 20, 1993
Plan 9
Page 76