Download GRAP A Language for Typesetting Graphs Tutorial and User Manual

Transcript
GRAP A Language for Typesetting Graphs
Tutorial and User Manual
Jon L. Bentley
Brian W. Kernighan
AT&T Bell Laboratories
600 Mountain Avenue
Murray Hill, NJ 07974
ABSTRACT
GRAP is a language for describing plots of data. This graph of the 1984 age distribution in the United States
5
4
Population
(in millions)
3
2
1
0
0
20
40
1984 Age
60
80
is produced by the GRAP commands
coord x 0,89 y 0,5
label left "Population" "(in millions)"
label bottom "1984 Age"
draw solid
copy "agepop.d"
(Each line in the data file agepop.d contains an age and the number of Americans of
that age alive in 1984; the file is sorted by age.)
The GRAP preprocessor works with PIC and TROFF. Most of its input is passed
through untouched, but statements between .G1 and .G2 are translated into PIC commands that draw graphs.
December, 1984