(FWIW I think I even caused myself pain due to the title of this blog post).
Kaiser Fung (@junkcharts) did a makeover post on this chart about U.S. steel tariffs:
Kaiser’s makeover is good (Note: just because I said “good” does not mean I’m endorsing the use of pie charts):
But, I’m curious as to what others would do with the data. Here’s my stab at a single-geom makeover:
library(waffle) library(viridis) library(tidyverse) data_frame( country = c("Rest of World", "Canada*", "Brazil*", "South Korea", "Mexico", "Russia", "Turkey", "Japan", "Taiwan", "Germany", "India"), pct = c(22, 16, 13, 10, 9, 9, 7, 5, 4, 3, 2) ) %>% mutate(country = sprintf("%s (%s%%)", country, pct)) %>% waffle( colors = c("gray70", viridis_pal(option = "plasma")(10)) ) + labs( title = "U.S. Steel Imports — YTD 2017 Percent of Volume", subtitle = "Ten nations account for ~80% of U.S. steel imports.", caption = "Source: IHS Global Trade Atlas • YTD through September 2017\n* Canada & Brazil are not impacted by the proposed tariffs" ) + theme_ipsum_ps() + theme(legend.position = "top") + theme(axis.text = element_blank()) + theme(title = element_text(hjust=0.5)) + theme(plot.title = element_text(hjust=0.5)) + theme(plot.subtitle = element_text(hjust=0.5)) + theme(plot.caption = element_text(hjust=1))
The percentages are included in the legend titles in the event that some readers of the chart may want to know the specific numbers, but my feeling for the intent of the original pac-man pies was to provide a list that didn’t include China-proper (despite 45 using them to rile up his base) and give a sense of proportion for the “top 10”. The waffle chart isn’t perfect for it, but it is one option.
How would you use the data (provided in the R snippet) to communicate the message you think needs to be communicated? Drop a note in the comments with a link to your creation(s) if you do give the data a spin.
Pingback: Steel-ing a Makeover from Tariffic Post | Atlantic Tagmata AI Security Feed
It is hard to see separation between countries, maybe qualitative palettes work better?
colors = c("gray70", brewer.pal(10, "Paired"))
Pingback: Steel-ing a Makeover from Tariffic Post – Mubashir Qasim
I would just use the right side of the Fung plot above, and then simply re-title the plot to what it shows. The title on either pie chart would work fine. This would be better than a title for the plot that states the conclusion to be drawn. That can be in the text, or in a caption to the plot. I think that is the most straight forward, informative solution. But thank you for another approach.
When I copied and pasted the code into RStudio on a Win 10 pc I got the error ” (list) object cannot be coerced to type ‘double’ “
I re-sourced the code in a fresh R session on a different system and it worked fine. I put the code up at https://gist.github.com/hrbrmstr/42aff98aca45d29f4cda5e731bacdd8d since that’s an easier place to triage. If you can post the output of
sessionInfo()into a comment there I may be able to help debug the issue on your system.
since the point of the graphic is to spike a political bray, which graphic one uses doesn’t matter much. the only change for any would be to explicitly list China. FWIW.
and, according to reporting, it’s Mexico not Brazil that get the other exemption. until Dear Leader changes his mind.
Hi, this looks really great. However, when I run the code in RStudio it returns an error saying that the “object cannot be coerced to type ‘double'”. Seems that waffle cannot handle the data.frame. Any suggestions? Thanks a lot, Matthias
Sorry, my Ad-blocker blocked other comments, so I didn’t see that there was already a comment on this further above. I posted my sessionInfo() in the gist. Thanks!
Of all the three graphs, the waffle graph is the worst way to present this data. Like pie graphs, the waffle graph also makes comparison of different units difficult. Particularly on this example. Even if you manage to understand which country is which color, the colors are so similar that it’s impossible to tell them apart. So please don’t do this.
You’re welcome to your opinion. As you can see, others have disagreed with said opine. What makeover did you put out there for others to opine on?