« An example of focusing the chart on a message | Main | Here are the cool graphics from the election »

Comments

Boots the Goat

I loved this chart too and set out to try to recreate it in R with ggplot. I ended up getting frustrated and giving up. Anyone else try to recreate or create something similar with more luck?

Kaiser

BtG: I don't think ggplot is the way to go to do this chart. You can do this in base R by constructing it piece by piece. The key function needed is rect.
You have to figure out how to code the data into appropriate vectors to draw each box and fill it in with the right colors.
Also, you have to figure out the plot axes so as to put the boxes in the appropriate places.
Then you use text to add the annotations, and line to add tickmarks.

The comments to this entry are closed.

BOOTCAMP SUMMER '19



Link to Principal Analytics Prep

See our curriculum, instructors. Apply.
Kaiser Fung. Business analytics and data visualization expert. Author and Speaker.
Visit my website. Follow my Twitter. See my articles at Daily Beast, 538, HBR.

See my Youtube and Flickr.

Book Blog



Link to junkcharts

Graphics design by Amanda Lee

The Read



Keep in Touch

follow me on Twitter

Residues