Wolfram Research

Function Repository Resource:

XKCDConvert

Source Notebook

Modify graphics to appear hand-drawn in the style of the xkcd cartoon series

Contributed by: Simon Woods

ResourceFunction["XKCDConvert"][graphics]

modifies graphics to appear hand-drawn in the style of the xkcd cartoon series.

Examples

Basic Examples

Create a BarChart in the style of xkcd:

In[1]:=
ResourceFunction["XKCDConvert"][
 BarChart[{10, 1}, ChartLabels -> {"XKCD", "Others"}, PlotLabel -> "Popularity of questions on MMA.SE", Ticks -> {None, {{1, "Min"}, {10, "Max"}}}]]
Out[1]=

Style a Plot:

In[2]:=
f1[x_] := 5 + 50 (1 + Erf[x - 5]);
f2[x_] := 20 + 30 (1 - Erf[x - 5]);
ResourceFunction["XKCDConvert"][
 Plot[{f1[x], f2[x]}, {x, 0, 10}, Ticks -> {{{3.5, "1st Event"}, {7, "2nd Event"}}, Automatic}]]
Out[4]=

A PieChart:

In[5]:=
ResourceFunction["XKCDConvert"][
 PieChart[{9, 1}, ChartLabels -> {"XKCD", "Others"}, PlotLabel -> "Popularity of questions on MMA.SE"]]
Out[5]=

Plot random connected points in the style of xkcd:

In[6]:=
ResourceFunction["XKCDConvert"][
 ListLinePlot[RandomInteger[10, 15], PlotMarkers -> Automatic]]
Out[6]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

Source Metadata

License Information