# I give up, I am embracing pie charts

November 27, 2012
By

(This article was first published on Simply Statistics » R, and kindly contributed to R-bloggers)

Most statisticians know that pie charts are a terrible way to plot percentages. You can find explanations here, here, and here as well as the R help file for the `pie` function which states:

Pie charts are a very bad way of displaying information. The eye is good at judging linear measures and bad at judging relative areas. A bar chart or dot chart is a preferable way of displaying this type of data.

I have only used the `pie` R function once and it was to make this plot (R code below):

So why are they ubiquitous? The best explanation I’ve heard is that they are easy to make in Microsoft Excel. Regardless, after years of training, lay people are probably better at interpreting pie charts than any other graph. So I’m surrendering and embracing the pie chart. Jeff’s recent post shows we have bigger fish to fry.

``` N=10 for(i in 0:(N-1)){ x=cos(2*pi/N*i);y=x+1;z=(y-2)*22.5 bitmap(sprintf("Rplot%02d.png",i)) pie(c(y,8-y),col=c("white","yellow"),init.angle=135-z,border=FALSE,labels=NA) dev.off() } system("convert Rplot*.png pacman.gif") ##system("rm *.png") edited to save caffo's pngs (see comments) system("rm Rplot*.png") ```

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...