Olympic Pie Charts

First off, for the R nerds out there, (If you don’t care about R, skip to the next paragraph) I’m quickly becoming a huge fan of ggplot2.  Below is an example of combining a facet grid with pie charts using polar coordinates.  Pretty cool.  (I know most graphics people hate pie charts, but I think it works nicely, especially to display Olympic medal counts).  My only question about ggplot2 is how can I color in the background of a plao without changing the pie chart.  I’d like to highlight the plots for a country in years where they hosted the Olympics.  I’ve tried geom_rect() with unlimited bounds,  but this seems to have problems in polar coordinates.  Then I started to try using some grobs commands, but they appear to be out of date.  Any ggplot2 experts out there have any suggestions?

Below is a plot of the Olympic medals won by year for the top 26 countries (by medal count in the 2008 Olympics) for the years 1952 through 2008.  The size of the pie chart is proportional to the number of medals won by a team on a square root scale, and each pie chart shows the break down of total medals by type (gold, silver, or bronze).  So you can see, for instance, that in 2008 China won about 100 medals (in fact, it was exactly 100) and, it’s easy to see that over half of them were gold.  You can also see that the United State won slightly more medals that China (110 to be exact), but the distribution of medals was nearly evenly distributed across the three types (36 gold, 38 silver, 36 bronze).

The graph below is the same as above, but using raw values instead of square root.  This demonstrates why I used a square root scale.

Here is a graph of the top 26 countries by medal count from the 2008 Olympics, across the years from 1896 through 2008.


And finally, if you’re interested, here is a graph of all of the countries from 1952 through 2008, but it’s hard to really see anything.  
Cheers.  

Advertisements

Posted on July 26, 2012, in Math Pictures, Olympics, R, Sports. Bookmark the permalink. 2 Comments.

  1. Nice plots, but I think there is an misconception with the usage of Germany as well as Russia. It looks like the data is missing either West Germany and/or East Germany as well as Udssr/CCCP before 1992 and 1996 respectively.

    • It’s not missing that data, I just considered Russia differently than the USSR here. Likewise, I present Germany different than East/West Germany. I could certainly re-do the graph and force East/West Germany and the USSR to count for Germany and Russia, respectively.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: