Next: 4.1.1 Exercises Up: 4. SESSION FOUR Previous: 4. SESSION FOUR Contents Index

#
4.1 Cpt files

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:

1. Create simple, linear color tables given a master color table (several are built-in) and the desired -values at color boundaries (makecpt)

2. Create color tables based on a master cpt color table and the histogram-equalized distribution of -values in a gridded data file (grd2cpt)

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.

Table 4.1: Prime options available in makecpt.
Option | Purpose
-C | Set the name of the master cpt file to use
-I | Reverse the sense of the color progression
-V | Run in verbose mode
-Z | Make a continuous rather than discrete table

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.)

Table 4.2: The main switches and options in psscale.
Option | Purpose
-C cptfile | The required cpt file
-D xpos/ypos/length/width[h] | Sets the position of the center/left and dimensions of scale bar.
| Append h to get horizontal bar and give center/top instead
-I max_intensity | Add illumination effects

    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

Subsections

- 4.1.1 Exercises

Next: 4.1.1 Exercises Up: 4. SESSION FOUR Previous: 4. SESSION FOUR Contents Index