Modern neuroscience overwhelmingly relies on empirical evidence: the collection of data through observation or experimentation. Once the data have been collected, they must be analyzed, summarized, and shared with others. Data visualization is a crucial part of these steps, particularly when researchers communicate their results in scientific publications.
Despite the central role that data visualization plays in modern neuroscience, it is hardly taught at the undergraduate or graduate level. From my own short experience, you mostly pick it up as you go, starting in grad school. While there is nothing inherently wrong with such a hands-on, problem-based approach to learning, accurate and efficient graphical representation of data does follow a few basic but crucial principles. Simply put:
- make sure that you indicate what variable you are plotting (e.g. are you plotting the mean or the median? did you include a scale?)
- display the uncertainty about the plotted variable (again, indicate what you are plotting, e.g. standard deviations or percentiles)
Easy, right? Well… When Elana Allen and colleagues, from the Mind Research Network in Albuquerque, NM, surveyed 288 articles published in 2010 in six leading neuroscience journals, they found that a significant part of the figures did not include all of these basic features. That was especially true of figures that attempted to represent more than 2 dimensions by using color or shades of gray (“3D figures” in Allen’s words): most of those omitted reporting the uncertainty of the reported effects. It is admittedly difficult to analyze multi-dimensional data sets and represent them onto a flat two-dimensional image (hence the title of Allen and colleagues’ article: “Data Visualization in the Neurosciences: Overcoming the Curse of Dimensionality“). However, more disturbingly, only 43% of the 3D figures even labelled the dependent variable to begin with. All is not well with the simpler 2D figures, either: 30% of the figures that included some measure of uncertainty (error bars) failed to indicate which one.
‘Show more, hide less’
How can scientists produce better graphical representations of their data? The authors provide a series of recommendations in the form of a great checklist. But where the paper really shines, in my opinion, is in the brilliant case studies that it provides, which underline to what extent the structure of a dataset can be hidden when depicted with an inappropriate graphical display, and how to avoid this. The article is accessible for free here, so you can check out the figures yourself. Because the article is made available under an Elsevier user license, I’m reproducing some of the figures here. The copyright remains with Elsevier. You can find more information about the Elsevier user license here.
The first example (see their Figure 2 below) covers the venerable 2D bar plot, which the authors improve upon first with box plots and then by plotting an almost complete graphical representation of the dataset using a violin plot that is way more informative than the original. Personally, I’m also enthusiast about bee-swarm plots, which plot every single data point. I know of an R package for bee-swarm plots (check out the great graphical examples!); unfortunately, I don’t know of any equivalent for MATLAB that looks as good.
Moving to more complex data sets, Allen and colleagues turn to EEG and event-related potentials (ERP; see their Figure 3A below). There, they suggest displaying the uncertainty around the ERP waveforms using shaded areas (don’t forget to label what measure of uncertainty you’re plotting!). This is easy to implement in MATLAB, for instance using the boundedline function, by Kelly Kearney. The authors also encourage plotting a graphical representation of the results of statistical testing on the same plot. This makes total sense, adds minimal work to preparing the figure, and should definitely be standard practice.
The last example looks truly spectacular. Allen and colleagues use both color hues and transparency to illustrate areas of the brain that undergo significant changes in activity in a task-based functional MRI dataset (see their Figure 3B below). The conventional way of representing fMRI results would be to apply a threshold to the indices of brain activity, and only show those brain regions that were beyond the threshold. However, thresholds are arbitrary, and most of the brain’s activity gets “erased” from the plot. The authors’ approach allows them to show the data’s structure in a much more thorough fashion (in this case including areas of the brain that undergo de-activation during the task, likely corresponding to the “default mode network”), without cluttering the display or making it too complicated. They also provide an example dataset and MATLAB scripts to reproduce their figure.
‘The jet colormap must die!’
I found one minor weakness in Allen et al.’s paper: their recommendation of color scales (or colormaps). Specifically, for bipolar data, which can range from negative through zero to positive values, they suggest using a rainbow (or “jet”) colormap: negative values are mapped to progressively lighter shades of blue, moving to green for data whose value is zero, then through yellows and oranges to reds for positive data. There are several problems about this particular colormap, detailed in multiple papers and blog posts (I took this section’s title from one such post). To summarize them briefly:
- human vision does not perceive the color changes of the jet colormap as homogeneous, creating artificial “borders” (called Mach bands) when continuous surfaces are plotted (see the illustration below)
- the order of the colors is arbitrary (despite being that of the rainbow)
- the luminance of successive colors does not follow a monotonous increase or decrease
- the presence of greens and reds make it hard to interpret by people with the most common disturbance of color vision
For plotting bipolar data, other colormaps can avoid the “illusory border” problem, for instance a colormap that goes from cold (blue) to warm (red) colors. In the example above, I’ve taken the cold-to-warm colormap from an excellent paper on colormaps by Kenneth Moreland, of the Sandia National Laboratories, USA.
Apart from this minor objection, however, I warmly recommend reading Allen et al.’s thoughtful discussion–you will likely produce better data visualizations thanks to the authors!
(And if you still need to plot bar plots, I’ve got a great MATLAB function for you!)
Allen, E., Erhardt, E., & Calhoun, V. (2012). Data Visualization in the Neurosciences: Overcoming the Curse of Dimensionality Neuron, 74 (4), 603-608 DOI: 10.1016/j.neuron.2012.05.001
Moreland K. Diverging Color Maps for Scientific Visualization (Expanded). Proceedings of the 5th International Symposium on Visual Computing. 2009 December.