matplotlib/matplotlib — pull request #1329 by mdboom (2012-10-05 00:14:12+00:00)
Title: Add a "sketch" path filter

Based on the mailing list thread "XKCD style graphs", this adds a sketchy line path filter to matplotlib.

This PR is not complete, but I thought I'd get something up early so we can hack on it together.

To play with this, set the rcParam['path.sketch'] to a tuple (scale, length, randomness), for example (1.0, 128., 16.).

```
* *scale*: The amplitude of the wiggle perpendicular to the
source line, in pixels.

* *length*: The length of the wiggle along the line, in
pixels (default 128.0)

* *randomness*: The scale factor by which the length is
shrunken or expanded (default 16.0)
```

This currently only works with the Agg and PDF backends, though it should be easy enough to add to other vector backends by following the same procedure as the PDF backend. The Mac OS-X backend will require more care, but should be possible as it's been added to `path_cleanup.cpp`.

Beyond this, it would be nice to add a convenience function `xkcd_style`, or some such, that thickens the lines, removes the north and east spines, possibly changes the font, etc.