GRAPH(1) | General Commands Manual | GRAPH(1) |
graph - compile graphs into pic input
graph [ options ] [ filename ... ]
graph is a perl script which takes sets of X Y data and generates a (human readable) pic program that will produce the graphed data. The output is designed such that you can save it in a file and tweak it to make it fit your document. Try one and look at the output. The output is actually commented.
The graph is autosized and auto ticked.
The input data format is similar that of xgraph(1), i.e.,
1 1 2 2 3 3 "sloped across 1 4 2 4 3 4 "straight across
You may set the graph title, the X title, and the Y title with the following control sequences in the data stream:
%T Graph title in +4 point font %X X axis title and/or units in +2 point font %Y Y axis title and/or units in +2 point font %fakemax-X <value> force graph to be that big %fakemax-Y <value> force graph to be that big %fakemin-X <value> force graph to be that small %fakemin-Y <value> force graph to be that small
Workstation price performance from a Digital ad. Process with
graph -rev workstations | groff -TX75 "%T Workstation Price / Performance, 6/93 "%X SPECINT 92 Performance "%Y Price in $1000's 35 5 65 10 78 15 110 70 "Dec AXP line 25 4 25 8 38 16 48 21 52 23 64 27 "Sun SPARC line
Data points are x y1 y2 y3 y4 y5. You get a two lines from the first two y values, a mark at the third, and another line from the last two.
gtroff(1), gpic(1), perl(1).
This should probably be called pic_graph or something like that.
This isn't done as much as I would like. It isn't integrated with the groff preprocessor yet. It doesn't know about .GS/.GE things. I use it to manually generate a pic file and then include that.