Credits Overview Plotting Styles Commands Terminals

colormap

Syntax:

     set colormap new <colormap-name>
     set colormap <colormap-name> range [<min>:<max>]
     show colormaps

set colormap new <name> creates a colormap array <name> and loads it from the current palette settings. This saved colormap can be further manipulated as an array of 32-bit ARGB color values and used by name in subsequent plots.

Here is an example that creates a palette running from dark red to white, saves it to a colormap array named 'Reds', and makes all entries in the colormap partially transparent. This named colormap is then used later to color a pm3d surface. Note that the alpha channel value in a named colormap follows the convention for ARGB line properties; i.e 0 is opaque, 0xff is fully transparent.

     set palette defined (0 "dark-red", 1 "white")
     set colormap new Reds
     do for [i=1:|Reds|] { Reds[i] = Reds[i] | 0x3F000000 }
     splot func(x,y) with pm3d fillcolor palette Reds

The mapping of z values onto the colormap can be tuned by setting minimum and maximum z values that correspond to the end points. For example

     set colormap Reds range [0:10]

If no range is set, or if min and max are the same, then the mapping uses the current limits of cbrange. See set cbrange.

A colormap can be used to gradient-fill a rectangular area. See pixmap colormap.