Radar Charts of Decathlon Event Points for Decathletes in 2012 US Olympic Trials

More athletics dataviz. This time I thought I try to make radar charts. I was inspired by and initially tried to emulate the radar chart in this recent, interesting piece from R-Bloggers about visualizing tennis grand slam winners' performances. I first tried it with some performance data from this year's MLS combine, but I could not find a complete--or even decent--dataset. Instead, I decided to use track & field data, specifically this USATF page with the results for decathletes competing in the 2012 US Olympic Trials. The results are broken down by points-per-event, which is perfect for radar charts. I was able to render a radar chart in the style of the one in the R-Bloggers piece, but I also wanted to produce a chart for each athlete in the style of the facet function in ggplot2. That's when I discovered this blog page describing how to make radar charts using ggplot2. That blog page was extremely helpful, and it wasn't long before I was able to create this:

(click to enlarge)

The competitors' names are at the top of each subplot. The ten events of the decathlon are listed at the periphery of the radar charts, at each of the ten spokes. The numbers along the left-hand margin of the entire figure are the points that each of the concentric circles represent, with the exception of the outermost circle, which is unlabeled but should be 1200.

The farther out from the center toward one of the event names, the higher the athlete scored in that event. The bigger the overall shaded area, the higher the cumulative score for each athlete.

As always, I did some tweaking of the code used both in the blog page example and in my past faceting code. Specifically, I wanted to fill in the area described by the plotted contour line, which the blog page example did not do, and I wanted to arrange the facet subplots in the overall order in which the athletes finished in the actual event. To accomplish the fill, I added a specific fill aesthetic to geom_polygon. I included alpha in the aesthetic in order to see the grid lines through the fill, which I think makes the plots that much more readable. These are the relevant lines of code:

> DecMelt %>%
+   ggplot(aes(x=variable, y=value, group=Athlete, color=Athlete)) + 
+   geom_polygon(aes(fill=Athlete, alpha=0.5)) +

As for the order of the subplots, after I used the melt function from the reshape2 package as I did when I made the MLS attendance stacked area plots/pseudo-streamgraphs, I produced a variable with this structure:

> str(DecMelt)
'data.frame': 190 obs. of  3 variables:
 $ Athlete : Factor w/ 19 levels "Ashton Eaton",..: 1 18 10 13 3 17 16 14 4 11 ...
 $ variable: Factor w/ 10 levels "100m","Long Jump",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ value   : int  1044 975 876 867 755 804 894 838 776 912 ...

Running this variable through my code to make the facet subplots resulted in the subplots being arranged by order of the results of the first event (the 100 meters) rather than overall results. I wanted the overall results to be the order in which the subplots appeared, and to accomplish this I assigned the order of factor levels of $Athlete by passing a vector with each athlete's name. Fortunately there were not too many of them, and this process did the trick. Here is that code:

> DecMelt$Athlete <- factor(DecMelt$Athlete, levels = c( "Ashton Eaton", "Trey Hardee","Gray Horn","Joe Detmer",
+ "Chris Helwick","Ryan Harlan","Miller Moss","Kevin Lazas","Chris Randolph","Isaac Murphy","Curtis Beach",
+ "Bryan Clay","David Grzesiak","Edward Broadbent","Corbin Duer","Jake Arnold","Mike Ayers","Dakotah Keys","Wesley Bray"))

I really like the look of these charts, but there are still some things that bother me about them. I was never able to add all of the labels of the concentric rings, which in this figure are along the y-axis margin and exclude the outermost ring. I also wish the event labels on the subplots were entirely visible. There is enough of each label in view to make out which radar spoke represents which event, but it would look nicer if they were not cut off. I could have reordered the event labels so that the shorter ones were on the left and right margins or I could have tried to change the orientation of the labels that are cut off, but I wasn't sufficiently motivated to do so. For now, it was enough for me to be able to create these charts and work through my more immediate aesthetic concerns.


Popular Posts