GRAPH(1)

πŸ’– GRAPH(1) πŸ’–

okay bestie, welcome to graph, from the General Commands Manual, section 1, no cap. sit down, hydrate, let's get into it 🫢


✨ NAME ✨

graph β€” compile graphs into pic input. that's it, that's the job, and she does it flawlessly πŸ’…


✨ SYNOPSIS ✨

graph [ options ] [ filename ...  ]

✨ DESCRIPTION ✨

so graph is a perl script, right? she takes sets of X Y data and generates a (human readable) pic program that will produce the graphed data. the way she's set up?? the output is designed so you can save it in a file and tweak it to make it fit your document. literally just try one and look at the output. it's giving transparency because β€” plot twist β€” the output is actually commented. iconic behaviour tbh πŸŽ€

and the graph is autosized and auto ticked. no manual labour, we don't do that here ✨

the input data format is similar to that of xgraph(1), i.e.:

1 1 2 2 3 3 "sloped across

1 4 2 4 3 4 "straight across

✨ CONTROL OPTIONS ✨

you can set the graph title, the X title, and the Y title with these little control sequences in the data stream, and honestly? obsessed 😌

  • %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

✨ OPTIONS ✨

every single one, bestie, no skipping, we're thorough in this house πŸ’–

  • -rev β€” reverse X/Y data sense (and titles). ⚠️ note this is done after processing any fudging of the input data stream(s) (see -xk, -yk, -logx, etc below). order matters, periodt.
  • -below β€” put data set titles below the graph rather than to the right.
  • -close β€” no extra space around the data's endpoints. cozy vibes, zero personal space πŸ«‚
  • -qline β€” connect the quartile center points.
  • -grid β€” dotted line grid marks. aesthetic ✨
  • -nobox β€” no box around the whole graph. she's free, she's uncontained πŸ¦‹
  • -big β€” make the graph take the whole page. main character energy, honestly πŸ‘‘
  • -medium β€” make the graph take about 1/2 the page.
  • -small β€” make the graph be small. tiny. smol. πŸ“
  • -grapheach β€” draw each data set in its own graph.
  • -nolabels β€” no X/Y/Title labels.
  • -nodatal β€” no data set labels.
  • -nomarks β€” do not mark each data point with distinct markers (endpoints are still marked).
  • -k β€” print values larger than 1000 as value/1000.
  • -xk β€” multiply X input by 1024 (blech).
  • -yk β€” multiply Y input by 1024 (blech).
  • -xm β€” multiply X input by 1024*1024 (blech).
  • -ym β€” multiply Y input by 1024*1024 (blech).
  • -logx β€” convert X input into lag base 2 of X input.
  • -logy β€” convert Y input into lag base 2 of Y input.

✨ EXAMPLE ✨

workstation price performance from a Digital ad. process with:

graph -rev workstations | groff -TX75

and here's the data, bestie:

"%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

✨ QUARTILE FORMAT ✨

data points are x y1 y2 y3 y4 y5. you get two lines from the first two y values, a mark at the third, and another line from the last two. that's the whole vibe check, iykyk 🌸


✨ SEE ALSO ✨

gtroff(1), gpic(1), perl(1).


✨ BUGS ✨

okay so, keeping it real πŸ™ˆ:

  • 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.

and that's the whole page, bestie πŸ’œ she's from the General Commands Manual, section 1 β€” GRAPH(1) β€” and yes, this is the end of the page, no more content after this, slay βœ¨πŸŽ€πŸ’