Two identical bar charts: groups A and B both have a mean of 50 and the same error bar. Replot them as individual points and group A turns out to be 30 people spread evenly between 35 and 65, while group B is two distinct clusters, one around 30 and one around 70, with almost nobody in between. Group B tells a completely different story, and the bar chart hid it.
For years, guidance on data presentation has urged researchers to move away from bar charts with error bars, jokingly called “dynamite plots”, for continuous data, especially with small samples. Anscombe’s quartet, four datasets with nearly identical means, variances, correlations and regression lines but wildly different shapes, remains the classic demonstration of why you have to look at data.
Choose the chart for the question, not out of habit
| Question | Good choice | Avoid |
|---|---|---|
| Compare a continuous variable across a few groups | Dot plot with mean and confidence interval, boxplot with points, violin plot | Dynamite plots with small samples |
| Distribution of one variable | Histogram, density plot | Reporting only the mean |
| Relationship between two continuous variables | Scatter plot, with a trend line if needed | Joining points with lines |
| Change over time | Line chart, optionally with a confidence band | Bars for long time series |
| Parts of a whole | Horizontal bars sorted by size | Pie charts with many slices, 3D charts |
| Many coefficient estimates | Forest plot | A long table of asterisks |
Bar charts remain excellent for counts and proportions, where bar length is exactly the quantity being compared. The problem is only with using bars to summarise continuous data.
Let readers see the data points
With fewer than a few hundred observations per group, show every point. Where points overlap, use jitter or a beeswarm layout. With larger samples, violin plots or raincloud plots, which combine a density, a boxplot and the points, preserve the shape of the distribution. For paired data, connect each person’s two measurements with a thin line: readers see immediately how many went up and how many went down, which two bars of means can never show.
Error bars: always say what they are
An error bar can be a standard deviation, a standard error or a 95% confidence interval, and their lengths differ enormously. With 25 people per group, the SE is one-fifth of the SD. A chart that does not say which it shows cannot be read. The rules:
- To show how individuals vary: SD, or better, the data points themselves.
- To show the precision of an estimate: a 95% confidence interval.
- The SE is rarely the best choice: it shortens the bar without being easy to interpret.
- State the choice in the figure legend, along with group sizes.
Axes, scales and ways to mislead
- Bar charts must start at zero, because readers compare lengths. Starting the axis at 90 makes 95 look more than twice as large as 92.
- Dot and line charts need not start at zero; choose a range that shows meaningful variation.
- Avoid dual y-axes with different scales: the author can tune them to make two lines appear to move together or cross at will.
- Use a log scale for data spanning orders of magnitude, or for ratios such as ORs and RRs on a forest plot, and label it.
- Keep scales consistent across panels of small multiples unless there is a stated reason not to.
Colour: readable for everyone, even in greyscale
A substantial minority of men have some form of colour vision deficiency, most often difficulty distinguishing red from green. The red-green pairing that is the default in many packages is therefore a poor choice. Use palettes designed to be colour-blind safe, such as viridis or the Okabe-Ito palette, combine colour with point shape or line type, and test by printing in greyscale. Do not use colour as decoration: every colour should carry meaning.
Preparing figures for journals
- Export charts as vector files (PDF, EPS, SVG) where the journal accepts them; photographs and micrographs go in raster formats at the resolution the author guidelines specify.
- Draw at the final printed size, single or double column, so text remains legible after scaling.
- Use the same font and font size across all figures.
- Make each legend stand alone: what is shown, sample sizes, what the error bars represent and any abbreviations.
- Never manipulate images in ways that alter the data. Journals have image-processing policies; brightness adjustments must apply to the whole image and be described.
In practice: tools and a checklist
In R, ggplot2 with geom_jitter, geom_boxplot and geom_violin covers most needs. In Python, matplotlib and seaborn (stripplot, swarmplot, violinplot). The great advantage of plotting in code over point-and-click is reproducibility: when the data change, rerun the script and the figure is correct.
- The chart answers the question in the accompanying paragraph.
- Continuous data from small samples are shown as points, not just bars.
- Error bars are labelled by type, with sample sizes.
- Axes are labelled with units; bar charts start at zero.
- Colours are distinguishable for colour-blind readers and in greyscale.
- Text is legible at printed size.
- The legend stands alone.
Worth doing now: take the most important dynamite plot in your manuscript and redraw it as a dot plot with mean and confidence interval. If the new figure tells a different story, that is exactly what a reviewer would have spotted, and it is better that you spot it first.
Câu hỏi thường gặp
Why avoid bar charts with error bars for continuous data?
They show only a mean and one measure of spread, hiding the distribution, outliers and clusters. With small samples, a dot plot with mean and confidence interval is more honest.
Should error bars show SD, SE or confidence intervals?
Use SD or the raw points to show spread, and 95% confidence intervals to show precision of an estimate. Always state which you used in the legend.
Does the y-axis have to start at zero?
For bar charts yes, because readers compare bar lengths. For dot and line charts it is not required, provided the axis is clearly labelled.
How do I choose colour-blind friendly colours for charts?
Avoid red-green pairings, use palettes such as viridis or Okabe-Ito, combine colour with shapes or line types, and check the figure in greyscale.
What software is best for scientific plots?
R with ggplot2 and Python with matplotlib and seaborn are the most widely used. Plotting in code makes figures reproducible when data change.