4

I came across this great blog post on visualizations: http://www.darkhorseanalytics.com/blog/visualizing-distributions-3 It includes a set of plots with an aesthetic that looks like hand-drawn pencil. Is there a way to get a textured fill like this in R, preferably using ggplot2? I know about the hand-drawn fonts and lines available in the xkcd package, but I'm particularly interested in getting the hand-drawn fill effect, as shown in the following histogram (taken from the darkhorseanalytics link posted above), which isn't available in the xkcd package.

darkhorseanalytics pencil-fill histogram

Any ideas on how to create something like that in R?

To be clear, I'm looking for ideas about how to generate a hand-drawn fill effect, similar to the hand-drawn effect for lines that has been the subject of very productive brainstorming on this site. Fill effects are not easy to implement in ggplot2, but not impossible. Jittering a diagonal fill lines effect may be a reasonable place to start. Ben also mentioned annotation_raster() which would be another reasonable approach.

I know fill textures are not currently a priority for the ggplot2 development team, and they're difficult to implement for a number of reasons. That doesn't mean that they wouldn't be useful to have, or that we can't try to figure something out. :)

5
  • 1
    you might be able to cook something up with annotation_raster (see here ... ?
    – Ben Bolker
    Commented Dec 20, 2016 at 21:31
  • Related: How to add Texture to fill colors in ggplot2. If it's for one time use, I'd opt for Excel and the likes, which allow for textures easily.
    – lukeA
    Commented Dec 20, 2016 at 21:31
  • Thanks, @lukeA, I saw that question. It's a related issue, but the types of patterns used there don't approach the effect I'm looking for. I did wonder whether there would be a way to hack some of that material into a hand-drawn look, but I haven't made any progress with it. If you do, let me know! Commented Dec 21, 2016 at 0:11
  • No sorry, I dunno. I don't think that's what R is supposed to do, thus the lack of support for texture fills. As I said, I'd use Excel or an SVG editor to get a comic feel for graphics.
    – lukeA
    Commented Dec 21, 2016 at 0:26
  • 2
    Take a look at: xvrdm.github.io/ggrough
    – markus
    Commented Nov 10, 2019 at 20:32

0

Browse other questions tagged or ask your own question.