También disponible en Español

Inf@Vis!

The digital magazine of InfoVis.net

The spectral (or rainbow) palette
by Juan C. Dürsteler [message nº 192]

The rainbow (or spectral) palette is one of the most used and, in fact, is the one you find by default in many visualisation software packages. Nevertheless it isn't in general the best choice and can be misleading in many cases.
m81_Radio.gif (26107 bytes)
Interacting galaxies in the M81 group
Image in pseudocolour of the interaction of two galaxies in the M81 group, using the spectral palette. Light blue shadows are hydrogen clouds.
Source: As can be seen in the page about M81 form the National Radio Astronomy Laboratory en Socorro, NM, USA
Click on the image to enlarge it

In the past artícle number 184 Color guidelines, we described the Cynthia Brewer's proposal for choosing colour palettes. We recognised also some of the limitations of those guidelines.

In our scope a pallette is a set of colours available for its use in a visualisation software (see the definition in the glossary). Palettes are specially useful to map one or more variables with a wide range of values to a correspondingly large range of colours.  

Color Mapping

The technique that allows us to associate a gradation of colours to the values of one or more variables is called color mapping. It's one of the key techniques of information visualisation when dealing with the representation of a continuous sequence (or one with at least a wide range of values. This technique is also called pseudocolouring.

There are many examples of pseudocolour used in scientific visualisation, especially in Astronomy, Fluid Dynamics and Medical Imaging of data coming from techniques like Nuclear Magnetic >Resonance, or Axial Tomography.  As the recent article Rainbow Color Map (Still) Considered Harmful*  by David Borland and Russel Taylorvery well points out, in most of them the spectral palette is the one used (the one that contains all the colours of the rainbow in its physical order following each colours wavelength)

For example, more than 50% of the articles of IEEE Visualization Conference Proceedings between the years 2001 and 2005 used that palette. The fact that most of the visualisation systems offer this palette as the default one only worsens the situation. To Borland and Taylor, the use of this palette is similar to the use of the goto sentence in programming that plagued the software some decades (not that many) ago. Consequently our goal should be to erradicate the indiscriminate use of this palette.

Why is the spectral palette misleading? 

Because the sequence it represents doesn't make sense to our perceptual system. As Colin Ware explains in his book Information Visualization this can be demonstrated by providing a set of persons with a series of chips of painted paper with different gradations of gray (or for that matter of any other colour). If you ask them to order the chips, all of them produce an ordered sequence from dark to light or viceversa. If instead we provide them with the same chips but each one of a different colour, blue, yellow, red, green and we ask the same, the result is variable, since unlike the variation of luminance (brightness) that stimulates a sense of order, different colours don't have an obvious perceptual order.

Hence the spectral palette doesn't have a perceptual correspondent that could allow us to allocate ordered values to colours. Even worse, the transition between some colours, like between yellow and green is very quick, producing visual artifacts in the form of bands and frontiers that are nonexistent in the data set. These artifacts disappear when using a perceptual scale. 

Perceptual Scales

Silva_et_al.gif (245832 bytes)
Shading, Spectral Palette and Perceptual Palette. 
Source: As can be  seen in the  article Why Should Engineers and Scientists be Worried about Color
Click on the image to enlarge it.

In a perceptual scale the ordering of the data corresponds in a visually identifiable way with that of the colours in an obvious form for the visual system. The difference between using a spectral or a perceptual scale can easily be understood by looking at the figure included in the commendable article by Rogowitz and Treinish Why Should Engineers and Scientists be Worried about Color*. 

In the matrix of visualizations we can see, ordered by rows, 5 visualisations including among them a geographic one, a medical one and a fluid dynamics simulation. In each of the three columns we can see the same data depicted as a shadowed relief, using the spectral palette and finally using a perceptual palette. The advantages of this last one over the former are evident. 

When choosing a pseudocolour sequence, it's usual to use Stevens* taxonomy to the measurement scales. Stevens distinguishes between:  

  • Nominal: a scale designed to enable a quick visualisation of regions where the values don't have a particular order. Typically the data is categorical and the colours are selected just to differentiate some regions from the other ones, for example countries in a political map. 

  • Ordinal: in this case the scale enables the perceptual differentiation of the ordering of the variables associated to the colours. If th value 1 corresponds to colour A and value 3 corresponds to colour C then the value of 2 should correspond to the colour B, perceptually located between A and C.

  • Interval: is a scale where each interval within the sequence represents the same change in the magnitude of the variable we are representing. 

  • Ratio: a scale suitable to represent ratios and that contains a value corresponding to absolute 0. In these scales a value can be a multiple or a fraction of another and the sign can be positive or negative.

We have included Interval and Ratio into a super category Quantitative that differs from Nominal and Ordinal in that on this category we can perform arithmetic operations, i.e. it's composed by numbers.

Bergman, Rogowitz & Treinish propose in his article A Rule-based Tool for Assisting Colormap Selection a set of rules for the selection of colour scales based on the following aspects:

  • Data type, following tha above mentioned taxonomy (Nominal, Ordinal, Interval, Ratio)

    SensitivitySpatFreqColLum.gif (13654 bytes)
    Sensitivity to hue and luminance as a funtion of spatial frequency.
    Source: As can be seen in the Connexions.org website
    Click on the image to enlarge it. 
  • Spatial frequency. It refers to the variation of the characteristics of data as a funcion of its location in space (spatial variation). For example we can imagine a surface whose height is associated to the magnitude of a particular variable. A high spatial frequency tell us that the magnitude varies strongly in little change of space whereas a low frequency would mean a much softer change of properties in the same amount of space.  

    It's worth noting that human sensitivity to spatial variation is higher for hue at low frequencies (low detail) and it corresponds better with luminance (brightness or intensity) at high frequencies (more detail). Although spatial frequency can be considered a continuum, here we broadly distinguish two possibilities: 

    • High. In this case the palette to choose will benefit from changes in the luminance of only one hue 

    • Low. At low frequencies  the codification of the variable associating it to different hues is more appropriate than modifying the luminance.

  • Task to perform. Within the task that the user wants to perform they distinguish three possibilities:

    • Isomorphic. According to the authors, an isomorphic task is that one whose objective is to faithfully reflect the structure present in data. 

    • Segmentation. It aims to divide data into distinct categories from the perceptual standpoint.

    • Highlight. The goal here is to call the attention to singular or particular aspects of the data set.  

The conjugation of the data type with spatial frequency and the task to be performed produces a set of recommendation regarding Luminance, Hue and Saturation that come from the experience of the authors plus those derived from previous literature on the subject. For the convenience of the reader we reproduce here an equivalent table of the one in the article, that is in agreement with previous paragraphs. We encourage the interested reader to consult the referenced article to increase the knowledge of the subject.  

Data Type

Spatial

Frequency

Task

Isomorphic Segmentation Highlight
Nominal or Categorical Low Luminance: Uniform
Hue: Variation around the hue circle (HSV coordinates)
Saturation: uniform
Fewer segments than  7  Increase luminance or saturation of highlighted area
High N/A N/A N/A
Ordinal Low Luminance: Uniform
Hue: Variation around the hue circle (HSV coordinates)
Saturation: Monotonically decreasing
Fewer segments Increase  luminance of highlighted area
High Luminance: Monotonically increasing 
Hue: Variation around the hue circle (HSV coordinates)
Saturation: uniform
More segments Increase  saturation  of highlighted area
Quantitative Interval Low Luminance: uniform
Hue: Opponent pairs
Saturation: Monotonically increasing from gray
Many segments possible Larger range for highlighted features
High Luminance: Monotonically increasing.
Hue: Uniform or small hue variation
Saturation: Monotonically decreasing
Fewer segments Smaller range for highlighted features
Ratio (true zero) Low Luminance: Uniform
Hue: Opponent or complementary pairs
Saturation: Monotonically increasing from gray
Even number of segments

Many segments possible

Larger range for highlighted features
High Luminance: Monotonically increasing
Hue: Opponent or complementary pairs
Saturation: Monotonically increasing from grey
Even number of segments

Fewer segments

Smaller range for highlighted features
Recommendations to build a palette according to Bergman, Rogowitz and Treinish
Source: Adapted from the table in their article A Rule-based Tool for Assisting Colormap Selection

Which type of scale do we use then? As we have seen this depends on different factors like spatial frequency, task to perform and data type. As it happens in so many fields there's no single answer nor a universal palette that be the best one for any purpose. Nevertheless it's clear that there's a universally less appropriate palette that paradoxically is the most used: the spectral or rainbow palette. 


* Rainbow Color Map (Still) Considered Harmful  by Borland D. and Taylor, R.; in: Computer Graphics and Applications, IEEE
March-April 2007 Volume: 27, Issue: 2, page: 14-17

* Why Should Engineers and Scientists be Worried about Color, by Rogowitz, B and Treinish, L del IBM Thomas J. Watson Research Center,  Yorktown Heights New York, USA

On the Theory of Scales of Measurement by Stevens, S.S Science 7 June 1946 pages: 677-680. For example Colin Ware in Information Visualization, Robert Spence in his own book called also Information Visualization, and others use it.

A Rule-based Tool for Assisting Colormap Selection by Bergman, D; Rogowitz, B and Treinish, L del IBM Thomas J. Watson Research Center,  Yorktown Heights New York, USA

Links of this issue:

http://www.aoc.nrao.edu/intro/galaxies.html   Page about M81 at the National Radio Astronomy Laboratory, NM USA
http://www.infovis.net/printMag.php?num=184&lang=2   Num 184 Colour guidelines
http://www.infovis.net/printRec.php?rec=glosario&lang=1#Paleta   Glossary entry about Palette
http://www.infovis.net/printRec.php?rec=llibre&lang=2#InfoVisWare   The book Information Visualization by Colin Ware
http://www.research.ibm.com/people/l/lloydt/color/color.HTM   Article Why Should Engineers and Scientists be Worried about Color
http://www.research.ibm.com/dx/proceedings/pravda/index.htm   Article A Rule-based Tool for Assisting Colormap Selection
http://cnx.org/content/m11084/latest/   Connexions.org website
http://ieeexplore.ieee.org/xpl/RecentIssue.jsp?punumber=38   Article Rainbow Color Map (Still) Considered Harmful
http://www.infovis.net/printRec.php?rec=llibre&lang=2#InformationVisualisation   The book Information Visualization by Bob Spence
© Copyright InfoVis.net 2000-2014