next up previous contents index
Next: 4.15.2 Regular CPT files Up: 4.15 Color palette tables Previous: 4.15 Color palette tables   Contents   Index

4.15.1 Categorical CPT files

Note: This is an experimental component and is only available if you compile GMT with -DGMT_CPT2. Categorical data are information on which normal numerical operations are not defined. As an example, consider various land classifications (desert, forest, glacier, etc.) and it is clear that even if we assigned a numerical value to these categories (e.g., desert = 1, forest = 2, etc) it would be meaningless to compute average values (what would 1.5 mean?). For such data a special format of the CPT files are provided. Here, each category is assigned a unique key, a color or pattern, and an optional label (usually the category name). Keys must be monotonically increasing but do not need to be consecutive. The format is

key$_1$ fill label
...    
key$_n$ fill label

The fill information follows the format given in Section 4.14. While not always applicable to categorical data, the background color (for key-values $<$ key$_1$), foreground color (for key-values $>$ key$_{n}$), and not-a-number (NaN) color (for key-values = NaN) are all defined in the .gmtdefaults4 file, but can be overridden by the statements

B R$_{back}$ G$_{back}$ B$_{back}$
F R$_{fore}$ G$_{fore}$ B$_{fore}$
N R$_{nan}$ G$_{nan}$ B$_{nan}$


next up previous contents index
Next: 4.15.2 Regular CPT files Up: 4.15 Color palette tables Previous: 4.15 Color palette tables   Contents   Index
Paul Wessel 2011-02-27