I have a number of layers that represent the temperature variability of the water in a lake.

They have been generated trough interpolation and have different values as they represent temperatures from different seasons.

Everything looks fine in the maps except that they have similar colors although they represent different values. For example on the March-May map I have red for 10 degrees C, while for June-September the same red color is used for 20 C.

Ideally I should be able to extend the temperature (value) range for all of them to be the same. So if I look at the spring map I should seem more blue (suggesting colder water) while in the summer map more red regions.

I played with the d.legend and I can modify the range but only as a subset i.e if for spring I have 0-12 C I can reduce it to 0-8 C, but I cannot extend it to 0-20.

So now the question: How can I unify the legend ranges for all these layers so that a specific color represents the same value on all the maps?

I looked at r.recode and r.rescale, but they seem to take the same color range and change only the number corresponding to that color. I want to change the color for the value and not the opposite. In addition the rescaled scalebar is discontinued instead of a nice gradient.

2 Answers 2


For GRASS you can use the r.colors to modify the color table for a raster map.

r.colors also ships with pre-defined color maps for temperature scales. It's simple to use even

r.colors map=spring color=celsius

You can also copy the color table from one map to another

r.colors map=spring2 raster=spring

For more details see the GRASS GIS manual http://grass.osgeo.org/grass64/manuals/r.colors.html

  • Thanks, but will this procedure ensure that exactly the same color will correspond to the same value on all the maps? Your solution deals with color tables being common, but I am concerned about having the same range and each color to represent the same value among all the maps.
    – Bogdan
    Apr 15, 2014 at 18:04
  • Yes as long as each cell value for the same temperature remains the same it will get the same value. This is simply a mapping of the raw value to a color. This way 10 degrees will always be the same color no matter what other colors you have. And if you are not happy with the default colors you can easily create your own color scheme and then copy this over to the other maps. Apr 15, 2014 at 19:08
  • I checked the celsius color map and indeed keeps the same color for the same value across the layer. The only disadvantage I see with this method is that the legend will not have a common range. However, I can work around this by either displaying only the legend of one map when aggregate them in a multiple map figure.
    – Bogdan
    Apr 16, 2014 at 4:32
  • 1
    For grass, r.colors map=map1,map2,map3... will then use the same colorscale across multiple maps. From the docs, "In case several input raster maps are provided the range (min, max) of all maps will be used for color table creation. Hence the created color table will span from the smallest minimum to the largest maximum value of all input raster maps and will be applied to all input raster maps."
    – mankoff
    Apr 4, 2016 at 21:32

I could not find a way to do this in Grass, but it is possible in SAGA. Here is a brief recipe:

1) After you import the TIFF file into the project

2) you can go to the Properties panel in the Setting tab and lookk for Colors->Type->Scaling->Value Range

You can see something like Value Range 5:15.

3) Click in the text box and replace those values with the desired range. For example : 2:25.

4) Move the cursor and the changes values will appear in bold.

5) Click on the button Apply and you will notice that the colors will change accordingly.

6) Repeat all this steps for all the layers that need to have the same color code i.e. where the same color needs to correspond to the same value in all the maps.

This is good in cases where you need to compare for example temperatures in different seasons. Obviously increasing the range will make the variation appear less obvious, but where matching color code is more important than visual effect of a steep gradient this is a good way to achieve that through a common color scale. The initial scale is optimized to show the best (steepest) gradient, but by extending the range the gradient for the initial range becomes compressed as it spans over less color gradient/variation.

If the colors given be default (usually monochromatic) are not good enough you can modify them by changing the color bar (click in the right box of Colors->Type->Colors properties). You can select a predefined one or adjust it and save it as a .pl file that can be shared (use Load) among all the layers that need that common color scale.

I hope that this helps someone whit the same problems I had.

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.