Twenty rules for good graphics

[This article was first published on Research tips » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

One of the things I repeatedly include in referee reports, and in my responses to authors who have submitted papers to the International Journal of Forecasting, are comments designed to include the quality of the graphics. Recently someone asked on about best practices for producing plots. So I thought it might be helpful to collate some of the answers given there and add a few comments of my own taken from things I’ve written for authors.

The following “rules” are in no particular order.

  1. Use vector graphics such as eps or pdf. These scale properly and do not look fuzzy when enlarged. Do not use jpeg, bmp or png files as these will look fuzzy when enlarged, or if saved at very high resolutions will be enormous files. Jpegs in particular are designed for photographs not statistical graphics.
  2. Use readable fonts. For graphics I prefer sans-serif fonts such as Helvetica or Arial. Make sure the font size is readable after the figure is scaled to whatever size it will be printed.
  3. Avoid cluttered legends. Where possible, add labels directly to the elements of the plot rather than use a legend at all. If this won’t work, then keep the legend from obscuring the plotted data, and make it small and neat.
  4. If you must use a legend, move it inside the plot, in a blank area.
  5. No dark shaded backgrounds. Excel always adds a nasty dark gray background by default, and I’m always asking authors to remove it. Graphics print much better with a white background. The ggplot for R also uses a gray background (although it is lighter than the Excel default). I don’t mind the ggplot version so much as it is used effectively with white grid lines. Nevertheless, even the light gray background doesn’t lend itself to printing/photocopying. White is better.
  6. Avoid dark, dominating grid lines (such as those produced in Excel by default). Grid lines can be useful, but they should be in the background (light gray on white or white on light gray).
  7. Keep the axis limits sensible. You don’t have to include a zero (even if Excel wants you to). The defaults in R work well. The basic idea is to avoid lots of white space around the plotted data.
  8. Make sure the axes are scaled properly. Another Excel problem is that the horizontal axis is sometimes treated categorically instead of numerically. If you are plotting a continuous numerical variable, then the horizontal axis should be properly scaled for the numerical variable.
  9. Do not forget to specify units.
  10. Tick intervals should be at nice round numbers.
  11. Axes should be properly labelled.
  12. Use linewidths big enough to read. 1pt lines tend to disappear if plots are shrunk.
  13. Avoid overlapping text on plotting characters or lines.
  14. Follow Tufte’s principles by removing chart junk and keeping a high data-ink ratio.
  15. Plots should be self-explanatory, so included detailed captions.
  16. Use a sensible aspect ratio. I think width:height of about 1.6 works well for most plots.
  17. Prepare graphics in the final aspect ratio to be used in the publication. Distorted fonts look awful.
  18. Use points not lines if element order is not relevant.
  19. When preparing plots that are meant to be compared, use the same scale for all of them. Even better, combine plots into a single graph if they are related.
  20. Avoid pie-charts. Especially 3d pie-charts. Especially 3d pie-charts with exploding wedges. I promise all my students an instant fail if I ever see anything so appalling.

The classic books on graphics are:

These are both highly recommended. (If you can’t see the books above, turn off your ad-blocker.)


To leave a comment for the author, please follow the link and comment on their blog: Research tips » R. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)