> They work great for troff, now I just need to investigate applying the same 
> technique to grap.

You can do it in pic (and I think grap) by just emitting some text
before drawing something.  In fact you can do arbitrary postscript
code.  This snippet uses the Pr string to push the current color
on the stack and then switch to gray.  The Pb string restores the
previous color from the stack.


.de XX
\\X'\\$1'
.br
.sp -1
..
.ie \n(yr>=100 .ds Ps "ps: exec
.el .ds Ps PS
.ds Pr "\*(Ps currentrgbcolor 0.75 0.75 0.75 setrgbcolor
.ds Pb "\*(Ps setrgbcolor

.G1
frame ht 1.5 wid 4 top invis right invis
label bot "Time"
label left "Goodput"
ticks left out at 0 "0", 1000000 "1Mbps"
.XX "\*(Pr
copy "/tmp/6.829/FQCBR:net0-stput-0.dat!" thru / next at $1,$2 /
new solid
.XX "\*(Pb
copy "/tmp/6.829/FQCBR:net0-stput-1.dat!" thru / next at $1,$2 /
new solid
copy "/tmp/6.829/FQCBR:net0-stput-2.dat!" thru / next at $1,$2 /
.G2

Reply via email to