I was scrolling thru twitter and came across this tweet:

Yay for cycling and data viz together, but this pie chart kills me. So, I tried to be the change I wished to see in the world:

No data was forthcoming, but I’m a sucker for, um, 11 likes, so I thought I’d extract the data myself.

A pie chart encodes quantities as an area of colored pixels — if I can count the pixels by color, then that’s proportion data I’m looking for.

Not finding any handy online utility, I turned to my own toolkit. Since this pie chart reuses colors (sigh), I started by masking with a shape in powerpoint then taking an equal-sized screenshot of each wedge (thanks, clippy).

Now I can deal with the data in R! The gory details follow but the gist is:

read the raw RGB data for each pixel

oh no, 25k different colors? fine, use clustering to collapse similar colors to the just the distinct slices of the pie

take a look at what we get:

looks legit!

now we can extract the proportions and make our better data viz. tada:

And now for the literal gist: