Let’s talk colormaps.

T. Lennert and J. Martinez-Trujillo. Strength of response suppression to distracter stimuli determines
attentional-filtering performance in primate prefrontal neurons. Neuron, 70(1):141–52, Apr 2011. [pubmed]
[for less ranty, try here.]
Dear everyone who uses colormaps: The ‘jet’ colormap, the default colormap in MATLAB, is a perceptual disaster. STOP USING THAT SHIT. I mean, just what is happening in the lower right sector of these plots?
Okay, more background. The scale is a raster of a modulation index (area under ROC, to be particular) for a group of neurons, plotted over the time from stimulus onset. The big salient feature of each plot is a yellow band. You see the yellow band because each raster plot sorts its neurons according to the “latency,” that is, the earliest time that the modulation passed some arbitrary threshold. Because that arbitrary threshold coincides with yellow, the highest-luminance value on the colormap, effectively the authors have chosen a computational and graphical procedure that says “Hey, sort my data that it makes a nice yellow stripe down the middle, NO MATTER WHAT THE DATA ACTUALLY CONTAINS.”
And what is happening to the right of that stripe? Well, because your spatial resolution for chroma differences (and especially for blue) is much worse than that for luminance differences (which is why sane colormaps, that are not “jet”, always have a monotonic luminance component), you have to get your nose right up to the screen to decide that under the stripe is a pretty good mixup of blue and red and yellow — all over the scale. In other words, some of these cells are well modulated past where they pass the arbitrary threshold, but a lot of cells stop being modulated at all after they dinged the threshold. Which is conveniently difficult to discern due to the colormap — and kind of raises the question of how reasonable that threshold setting is, or the cell inclusion criteria are.
We’ll just note in passing that the sorting is done separately for EACH subplot, so that row-by-row comparisons of the cells can’t be done, and the “neuron number” scale on the left is pretty much meaningless. Which also, by the way, fully undermines the claim that modulation for larger ordinal differences(*) happens faster.
I hope you noticed after you got close up to the screen, that the dark red and dark blue values are a lot harder to distinguish than, say, the yellow-to-cyan colors that makes up the middle of the scale. You know, we should be easily able to see when things are at opposite ends of the scale, right? I mean, if we’re plotting our data, I mean.
What kind of insane colormap has the property that values spanning the extreme ends of the scale stand out less, and can’t be distinguished as easily as values in the noisy middle? Why, it’s MATLAB’s default colormap, of course!
You know, ggplot uses a much better preset for its color maps, as well as better alternatives. Just sayin’.
(*) You want to know the ironic punchline? This catastrophe is figure 4 of a paper ABOUT NEURAL PROCESSING OF ORDINAL COLOR SCALES. Seriously!
I’m not sure whether this belongs on the ranting-about-neuroscience blog, or the ranting-about-MATLAB blog. so it goes on both places.
Graham said,
May 8, 2011 at 3:13 am
To be fair to Matlab, you can turn off automatic color scaling if you want the two subplots to have equal color scales.
What would be a more reasonable default? B/W? A colormap with a single hue?
crowding said,
June 22, 2011 at 11:32 am
The paper describes the subplots having equal scales, so that’s not the problem.
Of the defaults available in MATLAB, any of the single hue maps are unproblematic, and if you want a multiple-hue map for the sake of more jnds, “hot” isn’t completely stupid.
Tim Tam said,
June 17, 2011 at 2:22 am
Just want to say that I’m a huge fan of this blog… I will be happy when only when MATLAB is forced into bankruptcy because noone will buy their shitty software… too bad every brain lab in the country is running thier crap even with all the free stuff available
Des said,
June 22, 2011 at 11:00 am
The problem with the plot you’re showing is not a flaw of the colormap, but the person using it to display their data…. It’s a total PEBKAC.
Jet’s awesome. Stop hating, and email the authors of that paper instead.
crowding said,
June 22, 2011 at 11:28 am
The reason it was used here is because it is the default, which is a problem with MATLAB. There are a whole lot of PEBKAC, and a whole lot of those K’s and C’s live at The Mathworks, Inc.
But I’ll bite. Point to one (one!) data display that jet is a good default choice for, as opposed to some other generic default. Perhaps you can explain why jet works well for that data, and in particular why it works better than hot, or gray, or 99 of the colormaps in the post going up tomorrow.