Bayesian (cross stitch) sampler

Make your own Bayesian cross stitch sampler with a free pattern of Bayes Theorem and the accompanying Illustrator template
cross stitch
pandemic boredom

Tuesday, January 26, 2021


Jump to the downloads and get your own free pattern!

For my latest pandemic art medium (on this, the three hundred and nineteenth day of sheltering in place), I decided to teach myself how to cross stitch. I did a ton of needlepoint as a kid and teen, but was always afraid of cross stitch because it was so much smaller and more delicate.

I somehow stumbled across this lesson repository created by The Carpentries, an organization that normally teaches workshops on reproducible research and data scientific software like R and Python. This nifty Cross Stitch Carpentry workshop is incredibly helpful and easy to follow, and after downloading a pattern from Etsy, I successfully made my first cross stitched thing: a miniature porg.

I next wanted to make something related to my work with data and stats. In July, I made a linocut print of the R logo, so I considered doing that with cross stitch too, but that seemed like a lot of thread. Also, I couldn’t find a good way to make a good pattern. There’s a neat Python program named ih that automatically creates embroidery and cross stitch patterns from images, and there are plenty of (sketchy?) online resources for converting images to patterns (they probably rely on ih behind the scenes?), but I like having more control over the output.

After lots of googling, I found that you can use Adobe Illustrator to create cross stitch patterns (there’s an archived Facebook Live video showing the process here), which is perfect, since I use Illustrator all the time.

So I drew the formula for Bayes’ theorem with little boxes, added some flourishes and borders, and made my first cross stitch pattern, which I then made into an actual cross stitch: a Bayesian sampler!

A cross stitched Bayesian sampler

The color palette is inspired from the jewel colors of the 2021 inauguration (via Cianna Bedford-Petersen’s R package). The density plots in the corners and center are stylized prior and posterior distributions. The borders on the top and bottom are stylized trace plots showing intertwined MCMC chains.

I’ve polished the pattern in Illustrator and released it for free! (with a Creative Commons license). I’ve also provided the original Illustrator file so that you can make your own designs—just delete the stuff on the Text and Pattern layers and add little rectangles filled with some color + a 0.5 point white stroke.

Download everything here!

A Bayesian sampler


BibTeX citation:
  author = {Heiss, Andrew},
  title = {Bayesian (Cross Stitch) Sampler},
  pages = {undefined},
  date = {2021-01-26},
  url = {},
  doi = {10.59350/pdqkh-czk27},
  langid = {en}
For attribution, please cite this work as:
Heiss, Andrew. 2021. “Bayesian (Cross Stitch) Sampler.” January 26, 2021.