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(...)`.