The default option for matplotlib's pcolormesh (also true for VisIt and I think also true for Matlab) is to allow the maximum and minimum of a colorbar vary. Which in my case looks like:

before after

I think that this default behavior makes sense and is also much more aesthetically pleasing.

However, my advisor wants me to keep the colorbar at some fixed maximum throughout the plots. The result is the same for the initial plot and this for the final plot:

enter image description here

and the tracer concentration has entirely disappeared!

The reason he gave for keeping the colorbar fixed is that otherwise it is deceiving; at a glance it looks like there is more tracer concentration later than before, but there should be less since it has diffused. Also, he argued that the intense colors distract and make it hard to locate where the vortices have moved to.

I feel like a reader should be assumed to be competent enough to look at the colorbar. Also, the I think that the colors help the reader to see where the vortex is.

My question is: for scientific plots is there a default/consensus position either that (i) plots should have variable colorbars or (ii) plots should have fixed colorbars?

If not, what factors should guide one to producing plots (with colorbars) with the most scientific value?

I say "scientific value" as opposed to "aesthetic value" but if you think aesthetics should be a factor of some weight please justify yourself or give a reference to support yourself.

  • 3
    $\begingroup$ Have you tried plotting the concentration on a log scale? If the actual values are not terribly important, it might allow you to cover the range better. If you can't switch the colorbar itself to a log scale, you can always just plot log() of your concentration. $\endgroup$
    – Bill Barth
    Commented May 3, 2015 at 19:43
  • $\begingroup$ @BillBarth I tried this and it may solve this particular problem (the colorbar is essentially fixed and it covers the range better), but I have run into similar colorbar arguments before, so I'd prefer someone to answer my above question(s) more directly. Do you think I should remove the current problem specific part and just leave "My question is...", close this question and start a new one, or leave this question as it is? $\endgroup$ Commented May 3, 2015 at 20:28
  • $\begingroup$ @RyanFaber I think that the question is interesting. There are some guidelines for visualizations with colormaps $\endgroup$
    – nicoguaro
    Commented May 3, 2015 at 22:06
  • $\begingroup$ @nicoguaro what guidelines are you referring to? (That is, please give links or references.) $\endgroup$ Commented May 3, 2015 at 22:41
  • $\begingroup$ @RyanFarber, I added an answer. You should reconsider edit the title of your question. $\endgroup$
    – nicoguaro
    Commented May 4, 2015 at 18:26

2 Answers 2


The selection of colormap should be based on your dataset and audience, e.g., you do not want to use a colormap that have some cultural background for a group of people. Also, if your images are going to be printed (in grey scale), you should consider using a colormap that will preserve the ordering after the color transformation.

Then, you should take into account that when using/designing a colormap you are doing a mapping from the values in your dataset to a color space. This space can be defined in $(R,G,B)$ components, but there exist other color spaces that are more intuitive like $(H,S,V)$ (Hue, Saturation, Value) and $(H,S,L)$ (Hue, Saturation, Lightness). Based on this, we can think that a (univariate) color scale is equivalent to a path in the color space. The rainbow colormap changes the Hue. From the matplotlib documentation:

    These colormaps are approximately monochromatic colormaps varying smoothly
    between two color tones---usually from low saturation (e.g. white) to high
    saturation (e.g. a bright blue). Sequential colormaps are ideal for
    representing most scientific data since they show a clear progression from
    low-to-high values.

    These colormaps have a median value (usually light in color) and vary
    smoothly to two different color tones at high and low values. Diverging
    colormaps are ideal when your data has a median value that is significant
    (e.g.  0, such that positive and negative values are represented by
    different colors of the colormap).

    These colormaps vary rapidly in color. Qualitative colormaps are useful for
    choosing a set of discrete colors. For example::

        color_list = plt.cm.Set3(np.linspace(0, 1, 12))

    gives a list of RGB colors that are good for plotting a series of lines on
    a dark background.

You can also use redundant colormaps, where you play with more than one parameter at the time, an example for the rainbow colormap. This talk in SciPy 2014, discuss some topics of colormaps in matplotlib and is really enlightening, the slidese can be found here.

Why using colormaps

Some reasons to use colormaps are:

  • Mimic reality (use the same set of color that appear in the physical world)
  • Show classification (qualitative)
  • Show value (quantitative)
  • Draw attention
  • Show grouping / similarities

That is why some scales are better at qualitative judgments [2] (Relative shapes and sizes). And, Other color scales are better for quantitative judgments (Looking up values), that is the application that you are interested now.

Trumbos's Principles

Trumbo's Principles present some guidelines to take into account when designing/using colormaps [1]:

  • Order: ordered values should be represented by ordered colors
  • Separation: significantly different levels should be represented by distinguishable colors
  • Rows and columns: to preserve univariate information, display parameters should not obscure one another
  • Diagonal: to show positive association, displayed colors should group into three perceptual classes: diagonal, above, below

The rainbow colormap is not good at present the color information ordered, and that is why some people suggest to avoid it [3]. Although there are versions of the raibow colormap that are redundant and present the ordering property. Some examples of colormaps


[1] Bruce E. Trumbo (1981), Theory for Coloring Bivariate Statistical Maps, The American Statistician, vol. 35, no. 4, pp. 220-226. url.

[2] Ware, C., (1988). Color Sequences for Univariate Maps: Theory, Experiments and Principles. IEEE Computer Graphics and Applications. 8(5), 41-49. url.

[3] Borland, David, and Russell M. Taylor II. "Rainbow color map (still) considered harmful." IEEE computer graphics and applications 27.2 (2007): 14-17. url

[4] Kovesi Peter (2015) Bad Colour Maps Hide Big Features and Create False Anomalies. ASEG Extended Abstracts 2015 , 1–4. url

[5] Rougier, Nicolas P., Michael Droettboom, and Philip E. Bourne. "Ten simple rules for better figures." PLoS computational biology 10.9 (2014): e1003833. url


I agree that using the same color scale is generally good practice. Not doing so is confusing. Now, as you note, there are cases where this doesn't leave very much information in each picture. In such cases, you should at least make it clear in the caption that you are using different color scales for different panels of a figure.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.