When I study data visualization, I do so earnestly. That is, I approach it with an open mind and enthusiasm. In truth I like all of the visualizations mentioned above and you should check them out. But that doesn’t mean I can’t chime in with my own remix.
So in this post I’m going to offer up my own spin on this data visualization, and provide you R code that will enable you to remix mine if you like. If you do, be sure to tell me about it.
Anatomy of my viz
My remix is going to be slightly more complicated. This might be due to the fact I am cursed with knowledge, having studied unemployment trends quite closely. I feel like we can densify and add layers to the viz to convey even more information, even in a compact space.
Because I’m gunning for a more complex viz and small multiples, let’s first break down the visualization piece by piece. Take a look:
This chart is a composite chart consisting of two lines, two shaded ribbons shading the area between the lines and a rug chart at the bottom. The chart compares the unemployment rate in Ohio (depicted by a solid line) relative to the national average unemployment rate for the United States (depicted by a dotted line. I’ve also colored the area between the two lines, using red to signify periods when Ohio had a higher unemployment rate than the U.S. in red and when Ohio had a lower unemployment rate than the U.S. in blue. I’ve further encoded these periods with the rug plot at the bottom.
Examining the chart, we can see that throughout the 1980s and most of the 2000s, Ohio fared worse than the national average in terms of unemployment, while the Buckeye State did better in the 1990s and much of the past ten years.
Now that we’ve broken the simple chart down, we can build a small multiple showing the same chart for each of the 50 states.
Instead of the small multiple, we could use a gif to animate the chart.
For smoothanimations we’ll use tweenr. See my earlier post about tweenr for an introduction to tweenr, and more examples here and here.
How I build these charts
Building these charts is quite easy with R. In the code below, I’m going to grab the data, do some manipulations and create the charts.