The cpt file is discussed in detail in the GMT Technical Reference and COokbook, Chapter 4. Please review the format before experimenting further.
Cpt files can be created in any number of ways. GMT provides two mechanisms:
One can also make these files manually or with awk or other tools. Here we will limit our discussion to makecpt. Its main argument is the name of the master color table (a list is shown if you run the program with no arguments) and the equidistant -values to go with it. The main options are given below.
To make discrete and continuous color cpt files for data that ranges from -20 to 60, with color changes at every 10, try these two variants:
makecpt -Crainbow -T-20/60/10 >! disc.cpt makecpt -Crainbow -T-20/60/10 -Z >! cont.cpt
We can plot these color tables with psscale; the options worth mentioning here are listed in Table 4.2. In addition, the -B option can be used to set the title and unit label (and optionally to set the annotation-, tick-, and grid-line intervals for the colorbars.)
psbasemap -R0/8.5/0/11 -Jx1i -P -B0 -K >! bar.ps psscale -D3i/3i/4i/0.5ih -Cdisc.cpt -B:discrete: -O -K >> bar.ps psscale -D3i/5i/4i/0.5ih -Ccont.cpt -B:continuous: -O -K >> bar.ps psscale -D3i/7i/4i/0.5ih -Cdisc.cpt -B:discrete: -I0.5 -O -K >> bar.ps psscale -D3i/9i/4i/0.5ih -Ccont.cpt -B:continuous: -I0.5 -O >> bar.ps