|
|
1.1 root 1: grap is a pic preprocessor for drawing graphs.
2:
3: grap [files] | pic | ... (mrkos!/usr/bin so far)
4:
5: .G1
6: frame ht e wid e top dotted ...
7: sets frame around graph to specified ht and wid;
8: default ht 3, wid 2
9: default mode applies to all four sides;
10: you can set top, bot, left or right
11: to dotted, dashed, invis, solid independently
12: label side "a label" "as a set of strings" adj
13: one line per label, on the four sides.
14: default side is bot
15: adj is up|down|left|right expr, to shift default position
16: ticks side inout at optname expr, expr, ...
17: put ticks on side at expr, ..., and label with "expr".
18: if any expr followed by "...", label tick with "...",
19: and turn off all automatic labels.
20: if "..." contains %f's, they will be interpreted as printf
21: formatting instructions for the tick value.
22: ticks point in or out according to inout (default out)
23: tick iterator: instead of at ..., use from expr to expr by o expr
24: where o is optionally +-*/ for additive or multiplicative steps.
25: "by" can be omitted, to give steps of size 1.
26: if no ticks requested, they are supplied automatically;
27: suppress this with "ticks off". Automatic ticks normally
28: leave a margin of 7% on each side; set this to anything by
29: margin = expr
30: grid side linedesc at optname expr, expr, ...
31: draw grids perpendicular (!) to side in style linedesc
32: at expr, .... Iterators and labels work as with ticks.
33: coord optname x min, max y min, max log x log y (x, y literal!)
34: set range of coords and optional log scaling on either or both
35: overrides computation of data range
36: default value of optname is current coordinate system
37: (each "coord" defines new coord system)
38: plot "str" at point (or just "str" at point)
39: puts it at the point. you can add rjust, ljust, above, below after "...".
40: line from point to point linedesc
41: draw line from here to there.
42: "arrow" works in place of line.
43: next optname at point linedesc
44: continues plot of data in optname to point;
45: default is current
46: draw optname linedesc "..."
47: set mode for next: use this style from now on,
48: and plot "..." at each point (if given)
49: new optname linedesc "..."
50: set mode for next, but disconnect from previous
51: numberlist
52: x y1 y2 y3 ...
53: treated as
54: plot bullet at x,y1
55: plot bullet at x,y2
56: plot bullet at x,y3
57: etc., or as next at x,y1 etc., if draw specified.
58: abscissae of 1,2,3,... provided if only one input number per line
59:
60: point
61: optname expr, expr
62: maps the point to the coordinate system
63: linedesc
64: dot|dash|invis|solid optexpr
65: define name % whatever %
66: macros just like in pic
67: There are macros already defined for standard plotting
68: symbols like bullet, circle, star, plus: cat /usr/lib/grap.defines,
69: which is included if it exists.
70: var = expr
71: operators are = + - * / and ()
72: functions are log() and exp() (both base 10!), sin(), cos(), sqrt();
73: rand() returns random number on [0,1);
74: (you might check RAND_MAX at the top of grap.y)
75: max(e,e), min(e,e), int(e).
76: print expr; print "..."
77: as a debugging aid, prints expr or string on the standard error
78: copy "filename"
79: include this file right here
80: copy thru macro
81: pass rest of input (until .G2) through macros,
82: treating each field (non-blank, or "...") as an argument.
83: "macro" can be the name of a macro previously defined,
84: or the body of one in place, like / plot $1 at $2,$3 /
85: copy thru macro until "string"
86: stop copy when input is string (left-justified)
87: copy "filename" thru macro until "string"
88: combinations work too
89: pic remainder of line
90: copied to output with leading blanks removed.
91: graph Name pic-position
92: start a new frame, place it at specified position,
93: e.g., graph Thing2 with .sw at Thing1.se + (0.1,0)
94: Name is capitalized to keep pic happy.
95: .anything at beginning of line
96: copied untouched
97: sh X anything X
98: passes everything between the X's to the shell;
99: as with macros, X may be any character and "anything"
100: may include newlines.
101: # anything after # is a comment
102: .G2
103:
104: Order is mostly irrelevant; no category is mandatory.
105: The simplest graphs are like
106: .G1
107: 1
108: 2
109: .G2
110: or
111: .G1
112: 1 2
113: 3 4
114: 5 6
115: .G2
116: More complicated is like
117: .G1
118: frame top invis right invis
119: coord x 0, 10 y 1, 5 log y
120: ticks left in at 1 "bottommost tick", 2,3,4,5 "top tick"
121: ticks bot in from 0 to 10 by 2
122: label bot "this is a" "silly graph"
123: label left "left side label" "here"
124: grid bot dotted at 2,4,6,8
125: grid left dashed at 2.5
126:
127: copy thru / plot circle at $1,$2 /
128: 1 1
129: 2 1.5
130: 3 2
131: 4 1.5
132: 10 5
133: .G2
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.