Data Visualization for Neuroscience

Before we say a word about theory: scroll slowly through the gallery below. For each figure, ask yourself — do I like it or not, and why?


Now Let’s Take Them Apart

1. First principles: make the ink carry data

Gallery figure 10

This figure contains exactly three numbers. Count how many visual devices are competing to tell you them — and ask which of those devices encodes any data at all.

Removed: the tinted background, the white gridlines, the hatching, the heavy borders, the saturated primaries, the bold shouting label. Not one of them encoded data. What remains is three bars, three error bars, and a readable axis — the same information, now arriving in one glance instead of five.

Tufte’s term for the removed material is chartjunk, and his test is the data-ink ratio: of all the ink on the page, what fraction varies with the data? Decoration does not just waste space, it actively competes with the signal for the reader’s attention. When in doubt, delete something and see whether the figure got worse.

2. Show the data, not just a summary of it

In a survey of top physiology journals, 47.7% of papers used bar graphs to present continuous data, often for samples as small as n = 3–5 (Weissgerber et al. 2015). That is precisely where bars mislead most.

Gallery figure 1

A drug raises firing rate by 28%, with a star to prove it. What does this figure let you check — and what is it preventing you from seeing?

These are the same ten neurons. On the left, a clean 28% increase, error bars that barely overlap, p = 0.035. On the right, the drug group splits into two populations: five cells responded strongly and five did not respond at all. The mean sits in the empty gap between them, describing no cell in the experiment.

The statistics are not wrong — the test is significant. But “the drug raises firing rate by 28%” and “the drug strongly affects half of these cells and leaves the rest untouched” are completely different biological claims, and only one of them is true. The bar could not tell you which. Gallery figure 13, which you saw and probably liked, was the answer all along.

This is why bars are dangerous for continuous data at small n: a bar plus an error bar is a lossy compression with only two numbers surviving, and many very different datasets compress to the identical picture:

Same means, same SEMs, interchangeable bars — but A is normal, B is bimodal (its mean describes no real cell), C is driven by two outliers, and D is skewed. Show the points whenever n allows it: strip, box, violin, or raincloud (Weissgerber et al. 2015; Wilke 2019, ch. 9).

Gallery figure 14 makes the related point for paired designs. Each line is one subject measured twice. Plotted as two separate clouds these groups would overlap heavily and look unconvincing; drawn as pairs, every single subject increases. The pairing is the experiment, so the figure has to show it — and the matching paired test is far more powerful than the unpaired one.

3. Match the plot to the question

Gallery figure 8

There is clearly a relationship here. But what exactly is being claimed — how strong is it, in what units, and could this cloud have arisen by chance?

Same points both sides. The right panel adds a fitted line, a confidence band, and the two numbers a reader needs — that was gallery figure 11. A scatter alone asks your reader to eyeball a trend; adding the fit states the claim in units (“each 1% of contrast adds ~0.9 Hz”) and quantifies the uncertainty around it.

A caution in the other direction: never let the line replace the points. The line without the scatter hides how much variance is left over, which is exactly what the confidence band and \(r\) are there to admit.

Quick — from the pie, is there more SST or VIP? Is “Other” bigger than “NDNF”? Human eyes compare lengths along a common baseline well and angles and areas badly, so nine slices is close to unreadable. Sorting the same proportions into a bar makes every comparison instant. Reserve pies for two or three categories, if at all.

The two lines on the left appear to track each other — but that apparent relationship was manufactured entirely by the choice of axis ranges. Slide either axis and it vanishes. Dual y-axes let you imply a correlation you have not measured. Give each measure its own panel with a shared x-axis (right), and if you genuinely want to claim a relationship, plot one variable against the other and report a statistic (Midway 2020).

4. When you have too much data

Gallery figure 4

Twenty-eight single trials, all overlaid. What can you actually determine about any individual trial? What about the population?

The same traces. On the left they form an opaque mat — no trial is followable and the density is unreadable because lines drawn later simply cover lines drawn earlier. On the right, small multiples: one trial per panel, shared axes, so both the shared structure and the trial-to-trial variability are visible. That was gallery figure 12. All nine panels share one scale, marked once by the scale bar in the top-left panel, rather than repeating the same tick labels nine times — stripped axes are fine when the reader can recover them from a single shared key.*

When overlaying is genuinely necessary, plot the mean with a shaded variability band on top of faint individual traces, so the summary and the spread coexist without either being hidden.