makecpt - Make GMT color palette tables
] [ -D
] [ -I
] [ -M
] [ -N
] [ -Q
] ] [ -Tz0/z1/dz
] [ -V
] [ -Z
is a utility that will help you make color palette tables (cpt
files). You define an equidistant set of contour intervals or pass your own
z-table, and create a new cpt file based on an existing master cpt file. The
resulting cpt file can be reversed relative to the master cpt, and can be made
continuous or discrete.
The color palette includes three additional colors beyond the range of z-values.
These are the background color (B) assigned to values lower than the lowest
-value, the foreground color (F) assigned to values higher than the
-value, and the NaN color (N) painted whereever values are
If the master cpt file includes B, F, and N entries, these will be copied into
the new master file. If not, the parameters COLOR_BACKGROUND
, and COLOR_NAN
from the .gmtdefaults4 file or
the command line will be used. This default behavior can be overruled using
the options -D
The color model (RGB, HSV or CMYK) of the palette created by makecpt
be the same as specified in the header of the master cpt file. When there is
entry in the master cpt file, the COLOR_MODEL
specified in the .gmtdefaults4 file or on the command line will be used.
- Selects the master color table table to use in the interpolation.
Choose among the built-in tables (type makecpt to see the list) or
give the name of an existing cpt file [Default gives a rainbow cpt
- Select the colors for lowest and highest z-values in the output cpt
file as the back- and foreground colors that will be written to the cpt
file [Default uses the colors specified in the master file, or those
defined by the parameters COLOR_BACKGROUND,
COLOR_FOREGROUND, and COLOR_NAN].
- Reverses the sense of color progression in the master cpt file. Also
exchanges the foreground and background colors, including those specified
by the parameters COLOR_BACKGROUND and
- Overrule background, foreground, and NaN colors specified in the master
cpt file with the values of the parameters COLOR_BACKGROUND,
COLOR_FOREGROUND, and COLOR_NAN specified in the
.gmtdefaults4 file or on the command line. When combined with -D,
only COLOR_NAN is considered.
- Do not write out the background, foreground, and NaN-color fields [Default
will write them].
- Selects a logarithmic interpolation scheme [Default is linear]. -Qi
expects input z-values to be log10(z), assigns colors, and writes out z
[Default]. -Qo takes log10(z) first, assigns colors, and writes out
- Defines the range of the new cpt file by giving the lowest and highest
z-value and the interval. Alternatively, give the name of a ASCII file
that has one z-value per record. If not given, the existing range in the
master cpt file will be used intact.
- Selects verbose mode, which will send progress reports to stderr [Default
- Creates a continuous cpt file [Default is discontinuous, i.e., constant
colors for each interval].
To make a cpt file with z-values from -200 to 200, with discrete color changes
every 25, and using a polar blue-white-red colortable:
makecpt -Cpolar -T
-200/200/25 > colors.cpt
To make an equidistant cpt file from z = -2 to 6, in steps of 1, using
continuous default rainbow colors:
To make a GEBCO look-alike cpt file for bathymetry, run
gebco > my_gebco.cpt
will also interpolate from any existing .cpt file you may
have in your directory, you cannot use one of the listed cpt names as an
output filename; hence the my_gebco.cpt in the example.