Challenge found here. Goal: reproduce it as faithfully as possible.
Code is here and the generated document is here.
To build the example, you'll need a version of groff that has PDF generation support built-in. If it's not in the default path, execute make download; make GROFF=path2groff/groff. This also requires grap to pre-process the data.
Build notes:
- assumes Gmake is the default make.
- assumes grap has been installed.
Implementation notes:
- the zeroth and the fifth data points are slightly (in | de)dented compared to the original graph.
- Jon Bentley's original documentation for grap doesn't mention color. Given the document's completeness, it's clear this feature was added sometime later to the open-source implementation.
I also initially tried using gnuplot. On OSX, it required the user to do brew edit gnuplot and add --with-gpic to the arguments passed to configure. Unfortunately, its graph was able to make the red line but it appears the gpic driver is unable to rotate the label text (see Post Count for clarification).
Groff's internal processing flow:
There are two inputs to groff--t.dat and open_mic_posts.mom. while the Makefile only calls groff, groff calls the grap utility transparently because of the -G command-line option. See below for a general workflow:
Data: file "t.dat" "" width 105%; down; move;
Code: file "open_mic_posts.mom" "" width 210%
right; move; up; move
Grap: box rad 10px "grap"
arrow from Data.s to Grap.w
arrow from Code.n to Grap.w
right; move; move; move; move
Groff: box rad 10px "groff"
arrow dashed from Grap.e to Groff.w "Unix" "pipe"
move; move
Output: file "open_mic_posts.pdf" "" width 200%
arrow from Groff.e to Output.w
→ /pikchrshow