Twenty rules for good graphics

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 include 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.

Related Posts:

  • Pingback: Tweets that mention Twenty rules for good graphics | Research tips --

  • Steve P

    Thanks for the tips. I was already doing most of these things, but it’s good to know that you agree.

  • Petr

    rule #1- vector graphics is good only if you do not work with extremely large number of data points. A figure with millions of lines can be easily as large as hundreds of Mb when ps or pdf format is used. Also rendering of such image can take a long time Use of png IMO is a good choice then.

    • Rob J Hyndman

      Hi Petr. Thanks for your comment. I agree — I also use png when I have more than about 10000 points or lines.

  • Ben Bolker

    * Make as much text horizontal as possible (par(las=1), and possibly
    swapping x- and y-axes so that long labels sit along the y axis where
    they can be spelled out horizontally and not overlap)

    * eliminate redundant sets of axis labels for small multiple plots (à la lattice and
    ggplot) if possible

    * the ‘classic books’ aren’t showing up for me. Tufte and Cleveland?

    • Rob J Hyndman

      The books will be invisible if you have an adblocker. Yes, Tufte and Cleveland are the classics (imo).

  • Carlos

    I don’t understand # 15. Should it be something like “Plots should be self-explanatory, so avoid excessively detailed captions”?

    There should also be rule # 0: Have something to say. Too many charts are pointless.

    • Rob J Hyndman

      My point in #15 is to avoid the situation where you have to search all the surrounding text trying to figure out what the plot means, or what the variables are. This should be contained in the plot itself. If the plot is sufficiently self-explanatory that it doesn’t need much of a caption, that’s great. But sometimes explanation is required, and then it is better to put it in the caption rather than require the reader to find the information somewhere else.

      I agree with your rule #0!

  • Naomi B Robbins

    Some of your advice contradicts that of Cleveland. For example, Cleveland says,”Avoid putting notes and keys inside the scale line rectangle.”  Creating More Effective Graphs includes an example where the data and the key are difficult to distinguish since the key is inside the plot area.

    • Rob J Hyndman

      If there is no room for a key inside the region without causing confusion, then I wouldn’t do it. But often (at least in my plots) there are blank regions near one or more corners where a key can easily fit without obscuring anything.  Then I think it is neater to put the key inside. It is hard to have a consistent rule here. Perhaps we need a meta-rule that says don’t always follow the rules!

  • Pingback: Bilimsel Yayınlarda İyi Grafikler için 20 Öneri()

  • neilfws

    R/ggplot2 uses a grey background by default but it is simple to remove. Easiest way: + theme_bw()

  • Gaz

    You instantly fail your students if they use a chart type you don’t happen to like? I bet they think you’re an absolute jerk.

    • Rob J Hyndman

      My students recognize the sarcasm, even if my readers do not.

  • molecule61

    Regarding rule #7: You need to have a better reason not to include zero on your y axis than simply avoiding “excessive” whitespace. When you’re plotting data whose absolute value is meaningful, that whitespace may be part of the value.

  • Pingback: Hyndsight - A new candidate for worst figure()


    Thanks for making quick tips. That will surely help people to graph a lot better.

  • Pingback: Twenty rules for good graphics « AstroNayla()

  • Pingback: Twenty rules for good graphics | Wisdom and Wonder()

  • Pingback: Useful for referring—9-11-2014 | Honglang Wang's Blog()

  • Pingback: 좋은 그래프를 그리기 위한 스무가지 규칙 - NewsPeppermint - NewsPeppermint()

  • Jay Jang

    Thanks for the tips. I’ve been working in a financial securities firm for about 10 months now, where I started my first full-time job as a fresh graduate after the 2-year Korean military service that I had after my graduation in Australia.

    I am in a financial product planning team at a financial product strategy department within the firm. I occasionally write up some reports and they sometimes include few pie-charts and also the 3D pie-charts that you said not to use in the rule #20.
    Due to lack of knowledge and experience in the field, may I ask you the reasons not to use the pie-charts, sir?

    • Rob J Hyndman

      Any book on statistical graphics should discuss this. Try authors such as Bill Cleveland, Stephen Few, Naomi Robbins, …

  • Joe Lotz

    This post is an oldey but goody. I still reference people to read it!

  • Pingback: Twenty rules for good graphics | News for Plant Biology students()