The unique style of the diagrams at xkcd has an informative but nice hand-drawn touch. I guess they are actually drawn by hand but just recently on our partner site for Mathematica someone asked how to draw a similar diagram such as this one with Mathematica's plot functions (xkcd-style-graphs).

Now without Mathematica this should be possible as well but I have a hard time getting the details right. Can such a diagram be created in TeX with a similar design? My first attempt does not look particularly great but here it is (the font is from http://antiyawn.com/uploads/humorsans.html):

The reason why your plots seem to have too much noise in them is that you use the same number of samples for the random part. You could try creating a table with "clean" function values using pgfplotstable, then add random steps with a lower number of samples and plot the result.
– ChristophOct 1 '12 at 13:44

3

There is a variation of this using R to generate the graphic. With the intermediate use of knitr or sweave this can be integrated with LaTeX to import a very nice version of XKCD like graphics. See drunks-and-lampposts.com/2012/10/02/… I am going to use this technique to draw graphics for my statistics class to 'emulate' my handwriting. It will get a laugh.
– R. SchumacherOct 3 '12 at 0:12

4

Congratulations on the Great Question badge :)
– cmhughesOct 3 '12 at 15:23

1

I know I'm really late to the party, but xkcd is hand drawn. Source (check the title text).
– PiccoloMar 30 '13 at 22:35

that I can remember (because I've posted some answers) but please add more if I'm missing the obvious ones.

Regarding the answer, you can use decorations instead of random perturbations to your plots such that they are handled by TikZ instead. Also you can use a double line to achieve that white overlay over the previous line.

I don't have the Humor Sans font but I've used another similar font for using PDFLaTeX directly. Guys at SO have a better replacement for the font: xkcd style graphs in R

If creating plots using matplotlib (python) is an option, take a look at "XKCDify " (sorry, this isn't a "TeX answer", but inclusion of matplotlib-generated plots in TeX documents is common enough I think it's worth mentioning this here).