1MAKECPT(1) GMT MAKECPT(1)
2
3
4
6 makecpt - Make GMT color palette tables
7
9 makecpt [ -A[+]transparency ] [ -Ccpt ] [ -D[i|o] ] [ -E[nlevels] ]
10 [ -F[R|r|h|c ][+c]] [ -Gzlo/zhi ] [ -I[c][z] ] [ -M ] [ -N ] [
11 -Q[i|o] ] [ -Tz_min/z_max[/z_inc[+]] | -Tztable | -Tz1,z2,...,zn ] [
12 -V[level] ] [ -W[w] ] [ -Z ] [ -bibinary ] [ -dinodata ] [ -iflags ]
13
14 Note: No space is allowed between the option flag and the associated
15 arguments.
16
18 makecpt is a utility that will help you make static color palette
19 tables (CPTs). You define an equidistant set of contour intervals or
20 pass your own z-table or list, and create a new CPT based on an exist‐
21 ing master (dynamic) CPT. The resulting CPT can be reversed relative to
22 the master cpt, and can be made continuous or discrete. For color
23 tables beyond the standard GMT offerings, visit cpt-city:
24 http://soliton.vm.bytemark.co.uk/pub/cpt-city/.
25
26 The CPT includes three additional colors beyond the range of z-values.
27 These are the background color (B) assigned to values lower than the
28 lowest z-value, the foreground color (F) assigned to values higher than
29 the highest z-value, and the NaN color (N) painted wherever values are
30 undefined.
31
32 If the master CPT includes B, F, and N entries, these will be copied
33 into the new master file. If not, the parameters COLOR_BACKGROUND,
34 COLOR_FOREGROUND, and COLOR_NAN from the gmt.conf file or the command
35 line will be used. This default behavior can be overruled using the
36 options -D, -M or -N.
37
38 The color model (RGB, HSV or CMYK) of the palette created by makecpt
39 will be the same as specified in the header of the master CPT. When
40 there is no COLOR_MODEL entry in the master CPT, the COLOR_MODEL speci‐
41 fied in the gmt.conf file or on the command line will be used.
42
44 None.
45
47 -A[+]transparency
48 Sets a constant level of transparency (0-100) for all color
49 slices. Prepend + to also affect the fore-, back-, and nan-col‐
50 ors [Default is no transparency, i.e., 0 (opaque)].
51
52 -Ccpt Selects the master color table CPT to use in the interpolation.
53 Choose among the built-in tables (type makecpt to see the list)
54 or give the name of an existing CPT [Default gives a rainbow
55 CPT]. Yet another option is to specify
56 -Ccolor1,color2[,color3,...] to build a linear continuous cpt
57 from those colors automatically. In this case colorn can be a
58 r/g/b triplet, a color name, or an HTML hexadecimal color (e.g.
59 #aabbcc ).
60
61 -D[i|o]
62 Select the back- and foreground colors to match the colors for
63 lowest and highest z-values in the output CPT [Default uses the
64 colors specified in the master file, or those defined by the
65 parameters COLOR_BACKGROUND, COLOR_FOREGROUND, and COLOR_NAN].
66 Append i to match the colors for the lowest and highest values
67 in the input (instead of the output) CPT.
68
69 -E[nlevels]
70 Implies reading data table(s) from given command-line files or
71 standard input. We use the last data column to determine the
72 data range; use -i to select another column, and use -bi if your
73 data table is native binary. This z-range information is used
74 instead of providing the -T option. We create a linear color
75 table by dividing the table data z-range into nlevels equidis‐
76 tant slices. If nlevels is not given it defaults to the number
77 of levels in the chosen CPT.
78
79 -F[R|r|h|c][+c]]
80 Force output CPT to written with r/g/b codes, gray-scale values
81 or color name (R, default) or r/g/b codes only (r), or h-s-v
82 codes (h), or c/m/y/k codes (c). Optionally or alternatively,
83 append +c to write discrete palettes in categorical format.
84
85 -Gzlo/zhi
86 Truncate the incoming CPT so that the lowest and highest z-lev‐
87 els are to zlo and zhi. If one of these equal NaN then we leave
88 that end of the CPT alone. The truncation takes place before
89 any resampling. See also manipulating_CPTs
90
91 -I[c][z]
92 Append c [Default] to reverse the sense of color progression in
93 the master CPT. Also exchanges the foreground and background
94 colors, including those specified by the parameters COLOR_BACK‐
95 GROUND and COLOR_FOREGROUND. Append z to reverse the sign of
96 z-values in the color table. Note that this change of z-direc‐
97 tion happens before -G and -T values are used so the latter much
98 be compatible with the changed z-range. See also manipulat‐
99 ing_CPTs
100
101 -M Overrule background, foreground, and NaN colors specified in the
102 master CPT with the values of the parameters COLOR_BACKGROUND,
103 COLOR_FOREGROUND, and COLOR_NAN specified in the gmt.conf file
104 or on the command line. When combined with -D, only COLOR_NAN is
105 considered.
106
107 -N Do not write out the background, foreground, and NaN-color
108 fields [Default will write them].
109
110 -Q[i|o]
111 Selects a logarithmic interpolation scheme [Default is linear].
112 -Qi expects input z-values to be log10(z), assigns colors, and
113 writes out z [Default]. -Qo takes log10(z) first, assigns col‐
114 ors, and writes out z.
115
116 -Tz_min/z_max[/z_inc[+]] | -Tztable | -Tz1,z2,...,zn
117 Defines the range of the new CPT by giving the lowest and high‐
118 est z-value and interval. Append /z_inc to sample the input CPT
119 discretely at intervals z_inc between z_min and z_max; append a
120 trailing + to interpret z_inc as the number of desired intervals
121 instead. Alternatively, give the name of a ASCII file that has
122 one z-value per record, or provide a list of comma-separated
123 z-values instead. If -T is not given, the existing range in the
124 master CPT will be used intact.
125
126 -V[level] (more ...)
127 Select verbosity level [c].
128
129 -W[w] Do not interpolate the input color table but pick the output
130 colors starting at the beginning of the color table, until col‐
131 ors for all intervals are assigned. This is particularly useful
132 in combination with a categorical color table, like "categori‐
133 cal". Cannot be used in combination with -Z. Alternatively, use
134 -Ww to produce a wrapped (cyclic) color table that endlessly
135 repeats its range.
136
137 -Z Creates a continuous CPT [Default is discontinuous, i.e., con‐
138 stant colors for each interval]. This option has no effect when
139 no -T is used, or when using -Tz_min/z_max; in the first case
140 the input CPT remains untouched, in the second case it is only
141 scaled to match the range z_min/z_max.
142
143 -bi[ncols][t] (more ...)
144 Select native binary input. [Default is the required number of
145 columns given the chosen settings].
146
147 -dinodata (more ...)
148 Replace input columns that equal nodata with NaN.
149
150 -icols[+l][+sscale][+ooffset][,...] (more ...)
151 Select input columns and transformations (0 is first column).
152
153 -^ or just -
154 Print a short message about the syntax of the command, then
155 exits (NOTE: on Windows just use -).
156
157 -+ or just +
158 Print an extensive usage (help) message, including the explana‐
159 tion of any module-specific option (but not the GMT common
160 options), then exits.
161
162 -? or no arguments
163 Print a complete usage (help) message, including the explanation
164 of all options, then exits.
165
167 The PostScript language originally had no accommodation for trans‐
168 parency. However, Adobe added an extension that allows developers to
169 encode some forms of transparency using the PostScript language model
170 but it is only realized when converting the PostScript to PDF (and via
171 PDF to any raster image format). GMT uses this model but there are
172 some limitations: Transparency can only be controlled on a per-object
173 or per-layer basis. This means that a color specifications (such as
174 those in CPTs of given via command-line options) only apply to vector
175 graphic items (i.e., text, lines, polygon fills) or to an entire layer
176 (which could include items such as PostScript images). This limitation
177 rules out any mechanism of controlling transparency in such images on a
178 pixel level.
179
181 Some of the GMT master dynamic CPTs are actually two separate CPTs
182 meeting at a hinge. Usually, colors may change dramatically across the
183 hinge, which is used to separate two different domains (e.g., land and
184 ocean across the shoreline, for instance). CPTs with a hinge will have
185 their two parts stretched to the required range separately, i.e., the
186 bottom part up to the hinge will be stretched independently of the part
187 from the hinge to the top, according to the prescribed new range. If
188 the selected range does not include the hinge then no such partitioning
189 takes place.
190
192 For best result when -T -Z is used we recommend you do no append a spe‐
193 cific z_inc. This way the original CPT is used exactly as is but the z
194 boundaries are adjusted to match the stated limits. Otherwise you may,
195 depending on the nature of the input CPT, miss aspects of the color
196 changes by aliasing the signal.
197
199 To make a CPT with z-values from -200 to 200, with discrete color
200 changes every 25, and using a polar blue-white-red colortable:
201
202 gmt makecpt -Cpolar -T-200/200/25 > colors.cpt
203
204 To make an equidistant CPT from z = -2 to 6 using the continuous
205 default rainbow of colors:
206
207 gmt makecpt -T-2/6 -Z > rainbow.cpt
208
209 To use the GEBCO look-alike CPT with its default range for bathymetry,
210 run
211
212 gmt makecpt -Cgebco > my_gebco.cpt
213
214 or simply use -Cgebco directly in the application that needs the color
215 table. To create a 24-level rainbow color table suitable for plotting
216 the depths in the data table depths.txt (with lon, lat, depths), run
217
218 gmt makecpt -Cgebco depths.txt -i2 -Z -E24 > my_depths.cpt
219
220 To use the gebco color table but reverse the z-values so it can be used
221 for positive depth values, try
222
223 gmt makecpt -Cgebco -Iz > my_positive_gebco.cpt
224
225 To create a 24-level rainbow color table suitable for plotting the
226 depths in the data table depths.txt (with lon, lat, depths), run
227
228 To make a custom discrete color table for depth of seismicity, using
229 red color for hypocenters between 0 and 100 km, green for 100-300 km,
230 and blue for deep (300-1000 km) earthquakes, use
231
232 gmt makecpt -Cred,green,blue -T0,80,300,1000 -N > seis.cpt
233
234 To make a continuous CPT from white to blue as z goes from 3 to 10, try
235
236 gmt makecpt -Cwhite,blue -T3,10 -Z > cold.cpt
237
238 To make a wrapped (cyclic) CPT from the jet table over the interval 0
239 to 500, i.e., the color will be wrapped every 500 z-units so that we
240 always get a color regardless of the z value, try
241
242 gmt makecpt -Cjet -T0/500 -Ww > wrapped.cpt
243
245 Since makecpt will also interpolate from any existing CPT you may have
246 in your directory, you should not use one of the listed cpt names as an
247 output filename; hence the my_gebco.cpt in the example. If you do cre‐
248 ate a CPT of such a name, e.g., rainbow.cpt, then makecpt will read
249 that file first and not look for the master CPT in the shared GMT
250 directory.
251
253 gmt, grd2cpt
254
256 2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
257
258
259
260
2615.4.5 Feb 24, 2019 MAKECPT(1)