From 28d97cc88466f26d5cf647f842c51721e6737043 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Jul 2026 23:52:00 +0000 Subject: [PATCH 1/2] Initial plan From 9fc9fafde5e05c65e21fdd84d5155e01bec13ed1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Jul 2026 23:53:21 +0000 Subject: [PATCH 2/2] docs: expand README for xkcd.gp example --- README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ccb6ce..0243d29 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,25 @@ xkcd-gnuplot ============ -How to plot xkcd-style functions with gnuplot! +A small gnuplot example for making plots look a bit like an xkcd chart. ![Sample Graph](./xkcd.png) + +## Notes + +This is not a full xkcd rendering. The axes are still straight, and for plotted functions the random jiggle is only applied on the y coordinate. For datapoints, the same idea can be applied on both x and y. + +A proper solution would likely be a dedicated xkcd terminal for gnuplot, but this script keeps things simple. + +The script uses the Humor Sans font. The original TTF can be downloaded from antiyawn.com. For the EPS terminal, the font must be converted to PostScript PFA format. A converted `Humor-Sans.pfa` file is already included in the repository and referenced by the script. + +## How to use + +The main example is in `xkcd.gp`. Run it with gnuplot to generate `xkcd.eps`. + +The script defines two small helpers for adding wobble to plotted values: + +- `jiggle(x)` applies a small relative variation. Use it when the distortion should scale with the plotted value. +- `jigglea(x)` applies a small absolute variation based on a fixed range. Use it when you want a fixed-size wobble. + +In the included example, the damped sine and cosine curves use `jiggle(...)`, while the parabola-style guide line uses `jigglea(...)`.