colormapGMT creates colormaps in the Generic Mapping Tools (GMT) scheme (see References 1 to 4). A few such schemes are built-in, and may be referred to by name ("gmt_gebco", "gmt_globe", "gmt_ocean", or "gmt_relief") while others are handled by reading local files that are in GMT format, or URLs providing such files (see Reference 3).

colormapGMT(name, debug = getOption("oceDebug"))



character value specifying the GMT scheme, or a source for such a scheme. Four pre-defined schemes are available, accessed by setting name to "gmt_gebco", "gmt_globe", "gmt_ocean", or "gmt_relief". If name is not one of these values, then it is taken to be the name of a local file in GMT format or, if no such file is found, a URL holding such a file.


integer that, if positive, indicates to print some debugging output


colormap returns a list, in the same format as the return value for colormap().


The GMT files understood by colormapGMT are what GMT calls "Regular CPT files" (see reference 4). This is a text format that can be read and (with care) edited in a text editor. There are three categories of lines within this file. (1) Any line starting with the "#" character is a comment, and is ignored by colormapGMT. (2) Lines with 8 numbers specify colour bands. The first number is a z value, and the three numbers after that are red, green and blue values in the range from 0 to 255. This set of 4 numbers is followed on the same line with similar values. Think of this sequence as describing a band of colours between two z values. (3) Lines starting with a character, followed by three numbers, specify particular codings. The character "B" specifies background colour, while "F" specifies foreground colour, and "N" specifies the colour to be used for missing data (the letter stands for not-a-number). Only "N" is used by colormapGMT, and it takes on the role that the missingColor argument would otherwise have. (This is why missingColor is not permitted if name is given.)


  1. General overview of GMT system

  2. Information on GMT color schemes

  3. Source of GMT specification files

  4. CPT (color palette table) format


Dan Kelley