<-- home

Sleep Circle

I hate pie charts. They’re incredibly misleading and way overused. Walter Hickey has a great post on why you should never use them, but the entire argument can basically be summed up in an image:

Last night, while browsing /r/dataisbeautiful, however, I spied a pie chart that I actually kind of liked. I’m talking about this thing:

My daughters sleeping patterns for the first 4 months of her life. One continuous spiral starting on the inside when she was born, each revolution representing a single day is sitting at 52.4k upvotes and is, right now, the most liked post on /r/dataisbeautiful. Ever.

It seems the pie chart format is well suited for sleep data because time spirals like a clock. It doesn’t abruptly stop and start again on the other side of a bar or column. The graph is powerful, this once, because it helps to show circadian rhythms (and an infant finding hers).

I thought it would be fun to recreate /u/andrew_elliott’s graph, but the process he detailed in the comments was fairly opaque and unhelpful:

“Visualisation pattern was created using the CAD package Rhinoceros with Grasshopper plugin, using my own script. Then Adobe Illustrator was used for appearance. Source data was manually logged using Baby Connect iPhone app by my wife and myself.”

After futzing around in R for a couple of hours, with data that I simulated, I think I’ve come close to a viable recreation.

Here’s my version of /u/andrew_elliott’s Sleep Circle / Time Spiral Graph:

It’s obviously not an exact copy (it couldn’t be with fake data). But I think it captures everything I liked about the original.

If you’re interested in creating sleep-cirle-time-spiral graphy type things for yourself, perhaps with your own FitBit data (?), the script that underpins this post is available on GitHub