1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 99.2beta8 (1.46)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>4.15 Color palette tables</TITLE>
<META NAME="description" CONTENT="4.15 Color palette tables">
<META NAME="keywords" CONTENT="GMT_Docs">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v99.2beta8">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="GMT_Docs.css">
<LINK REL="next" HREF="node31.html">
<LINK REL="previous" HREF="node29.html">
<LINK REL="up" HREF="node15.html">
<LINK REL="next" HREF="node31.html">
</HEAD>
<BODY bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html1372"
HREF="node31.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A>
<A NAME="tex2html1366"
HREF="node15.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A>
<A NAME="tex2html1360"
HREF="node29.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A>
<A NAME="tex2html1368"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>
<A NAME="tex2html1370"
HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html1373"
HREF="node31.html">4.16 Character escape sequences</A>
<B> Up:</B> <A NAME="tex2html1367"
HREF="node15.html">4. General features</A>
<B> Previous:</B> <A NAME="tex2html1361"
HREF="node29.html">4.14 Specifying area fill</A>
  <B> <A NAME="tex2html1369"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html1371"
HREF="node149.html">Index</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H1><A NAME="SECTION0012150000000000000000">
4.15 Color palette tables</A>
</H1>
<P>
<A NAME="4335"></A>
<A NAME="4336"></A>
<P>
Several programs, such as those which read 2-D gridded data sets and create
colored images or shaded reliefs, need to be told what colors to use and
over what <I>z</I>-range each color applies. This is the purpose of the
color palette table (cpt-file). These files may also be used by <A NAME="tex2html256"
HREF="../psxy.html"><I><B>psxy</B></I></A><A NAME="4827"></A>
and <A NAME="tex2html257"
HREF="../psxyz.html"><I><B>psxyz</B></I></A><A NAME="4836"></A> to plot color-filled symbols.
The colors may be specified either in the RGB (red, green, blue) system or
in the HSV system (hue, saturation, value),
and the parameter COLOR_MODEL in the <U>.gmtdefaults</U> file must
be set accordingly. Using the RGB system, the format of the cpt-file is:
<P>
<DIV ALIGN="CENTER">
<TABLE CELLPADDING=3>
<TR><TD ALIGN="LEFT">z<IMG
WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img37.gif"
ALT="$_0$"></TD>
<TD ALIGN="LEFT">R<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img38.gif"
ALT="$_{min}$"></TD>
<TD ALIGN="LEFT">G<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img38.gif"
ALT="$_{min}$"></TD>
<TD ALIGN="LEFT">B<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img38.gif"
ALT="$_{min}$"></TD>
<TD ALIGN="LEFT">z<IMG
WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img13.gif"
ALT="$_1$"></TD>
<TD ALIGN="LEFT">R<IMG
WIDTH="25" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img39.gif"
ALT="$_{max}$"></TD>
<TD ALIGN="LEFT">G<IMG
WIDTH="25" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img39.gif"
ALT="$_{max}$"></TD>
<TD ALIGN="LEFT">B<IMG
WIDTH="25" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img39.gif"
ALT="$_{max}$"></TD>
<TD ALIGN="LEFT">[<B>A</B>]</TD>
</TR>
<TR><TD ALIGN="LEFT">...</TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
</TR>
<TR><TD ALIGN="LEFT">z<IMG
WIDTH="26" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img40.gif"
ALT="$_{n-2}$"></TD>
<TD ALIGN="LEFT">R<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img38.gif"
ALT="$_{min}$"></TD>
<TD ALIGN="LEFT">G<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img38.gif"
ALT="$_{min}$"></TD>
<TD ALIGN="LEFT">B<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img38.gif"
ALT="$_{min}$"></TD>
<TD ALIGN="LEFT">z<IMG
WIDTH="26" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img41.gif"
ALT="$_{n-1}$"></TD>
<TD ALIGN="LEFT">R<IMG
WIDTH="25" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img39.gif"
ALT="$_{max}$"></TD>
<TD ALIGN="LEFT">G<IMG
WIDTH="25" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img39.gif"
ALT="$_{max}$"></TD>
<TD ALIGN="LEFT">B<IMG
WIDTH="25" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img39.gif"
ALT="$_{max}$"></TD>
<TD ALIGN="LEFT">[<B>A</B>]</TD>
</TR>
</TABLE>
</DIV>
<P>
Thus, for each ``<I>z</I>-slice'', defined as the interval between two boundaries
(e.g., <I>z<IMG
WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img37.gif"
ALT="$_0$"></I> to <I>z<IMG
WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img13.gif"
ALT="$_1$"></I>), the color can be constant (by letting R<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img38.gif"
ALT="$_{min}$">
= R<IMG
WIDTH="25" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img39.gif"
ALT="$_{max}$">, G<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img38.gif"
ALT="$_{min}$"> = G<IMG
WIDTH="25" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img39.gif"
ALT="$_{max}$">, and B<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img38.gif"
ALT="$_{min}$"> = B<IMG
WIDTH="25" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img39.gif"
ALT="$_{max}$">) or a continuous,
linear function of <I>z</I>. The optional flag <B>A</B> is used to indicate anotation
of the colorscale when plotted using <A NAME="tex2html258"
HREF="../psscale.html"><I><B>psscale</B></I></A><A NAME="4846"></A>. <B>A</B> may be <B>L</B>,
<B>U</B>, or <B>B</B> to select anotation of the lower, upper, or both limits
of the particular <IMG
WIDTH="10" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img17.gif"
ALT="$z$">-slice. However, the standard <B>-B</B> option can be used
by <A NAME="tex2html259"
HREF="../psscale.html"><I><B>psscale</B></I></A><A NAME="4856"></A> to affect anotation and ticking of colorscales. The
background color (for <I>z</I>-values <IMG
WIDTH="16" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img42.gif"
ALT="$<$"> <I>z<IMG
WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img37.gif"
ALT="$_0$"></I>), foreground color
(for <I>z</I>-values <IMG
WIDTH="16" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img36.gif"
ALT="$>$"> <I>z<IMG
WIDTH="26" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img41.gif"
ALT="$_{n-1}$"></I>), and not-a-number (NaN) color (for
<I>z</I>-values = NaN) are all defined in the <U>.gmtdefaults</U>
file, but can be overridden by the statements
<P>
<DIV ALIGN="CENTER">
<TABLE CELLPADDING=3>
<TR><TD ALIGN="LEFT">B</TD>
<TD ALIGN="LEFT">R<IMG
WIDTH="27" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img43.gif"
ALT="$_{back}$"></TD>
<TD ALIGN="LEFT">G<IMG
WIDTH="27" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img43.gif"
ALT="$_{back}$"></TD>
<TD ALIGN="LEFT">B<IMG
WIDTH="27" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img43.gif"
ALT="$_{back}$"></TD>
</TR>
<TR><TD ALIGN="LEFT">F</TD>
<TD ALIGN="LEFT">R<IMG
WIDTH="27" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img44.gif"
ALT="$_{fore}$"></TD>
<TD ALIGN="LEFT">G<IMG
WIDTH="27" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img44.gif"
ALT="$_{fore}$"></TD>
<TD ALIGN="LEFT">B<IMG
WIDTH="27" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img44.gif"
ALT="$_{fore}$"></TD>
</TR>
<TR><TD ALIGN="LEFT">N</TD>
<TD ALIGN="LEFT">R<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img45.gif"
ALT="$_{nan}$"></TD>
<TD ALIGN="LEFT">G<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img45.gif"
ALT="$_{nan}$"></TD>
<TD ALIGN="LEFT">B<IMG
WIDTH="23" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img45.gif"
ALT="$_{nan}$"></TD>
</TR>
</TABLE>
</DIV>
<P>
which can be inserted into the beginning or end of the cpt-file. If
you prefer the HSV system, set the
<U>.gmtdefaults</U> parameter accordingly and replace red, green,
blue with hue, saturation, value. Color palette tables that contain
grayshades only may replace the r-g-b triplets with a single grayshade
in the 0-255 range.
<P>
A few programs (i.e., those that plot polygons such as <A NAME="tex2html260"
HREF="../grdview.html"><I><B>grdview</B></I></A><A NAME="4867"></A>,
<A NAME="tex2html261"
HREF="../psscale.html"><I><B>psscale</B></I></A><A NAME="4876"></A>, and <A NAME="tex2html262"
HREF="../psxy.html"><I><B>psxy</B></I></A><A NAME="4885"></A>) can accept pattern fills instead
of grayshades. You must give the pattern as in the previous section (no
leading <B>-G</B> of course), and only the first (low <IMG
WIDTH="10" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img17.gif"
ALT="$z$">) is used (we cannot
interpolate between patterns).
Finally, some programs let you skip features
whose <IMG
WIDTH="10" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img17.gif"
ALT="$z$">-slice in the cptfile has grayshades set to -. As an example,
consider
<P>
<DIV ALIGN="CENTER">
<TABLE CELLPADDING=3>
<TR><TD ALIGN="LEFT">30</TD>
<TD ALIGN="LEFT">p200/16</TD>
<TD ALIGN="LEFT">80</TD>
<TD ALIGN="LEFT">-</TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
</TR>
<TR><TD ALIGN="LEFT">80</TD>
<TD ALIGN="LEFT">-</TD>
<TD ALIGN="LEFT">100</TD>
<TD ALIGN="LEFT">-</TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
<TD ALIGN="LEFT"> </TD>
</TR>
<TR><TD ALIGN="LEFT">100</TD>
<TD ALIGN="LEFT">255</TD>
<TD ALIGN="LEFT">0</TD>
<TD ALIGN="LEFT">0</TD>
<TD ALIGN="LEFT">200</TD>
<TD ALIGN="LEFT">255</TD>
<TD ALIGN="LEFT">255</TD>
<TD ALIGN="LEFT">0</TD>
<TD ALIGN="LEFT"> </TD>
</TR>
</TABLE>
</DIV>
<P>
where slice <IMG
WIDTH="81" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img46.gif"
ALT="$30 < z < 80$"> is painted with pattern # 16 at 200 dpi,
slice <IMG
WIDTH="89" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img47.gif"
ALT="$80 < z < 100$"> is skipped, while slice <IMG
WIDTH="97" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img48.gif"
ALT="$100 < z < 200$"> is
painted in a range of red to yellow, depending on the actual value
of <IMG
WIDTH="10" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img17.gif"
ALT="$z$">.
<P>
<A NAME="4410"></A>
<A NAME="4411"></A>
<P>
<A NAME="4412"></A>
<A NAME="4413"></A>
<A NAME="4414"></A>
<A NAME="4415"></A>
<P>
Some programs like <A NAME="tex2html263"
HREF="../grdimage.html"><I><B>grdimage</B></I></A><A NAME="4895"></A> and <A NAME="tex2html264"
HREF="../grdview.html"><I><B>grdview</B></I></A><A NAME="4904"></A> apply artificial
illumination to achieve shaded relief maps. This is typically done
by finding the directional gradient in the direction of the artificial
light source and scaling the gradients to have approximately a normal
distribution on the interval <IMG
WIDTH="16" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img42.gif"
ALT="$<$">-1,+1<IMG
WIDTH="16" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img36.gif"
ALT="$>$">. These intensities are used
to add ``white'' or ``black'' to the color as defined by the <I>z</I>-values
and the cpt-file. An intensity of zero leaves the color unchanged.
Higher values will brighten the color, lower values will darken it,
all without changing the original hue of the color (see Appendix I
for more details). The illumination is decoupled from the data
grd-file in that a separate grdfile holding intensities in the
<IMG
WIDTH="16" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img42.gif"
ALT="$<$">-1,+1<IMG
WIDTH="16" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img36.gif"
ALT="$>$"> range must be provided. Such intensity files can be
derived from the data grdfile using <A NAME="tex2html265"
HREF="../grdgradient.html"><I><B>grdgradient</B></I></A><A NAME="4913"></A> and modified
with <A NAME="tex2html266"
HREF="../grdhisteq.html"><I><B>grdhisteq</B></I></A><A NAME="4922"></A>, but could equally well be a separate data set.
E.g., some side-scan sonar systems collect both bathymetry and
backscatter intensities, and one may want to use the latter information
to specify the illumination of the colors defined by the former.
Similarly, one could portray magnetic anomalies superimposed on
topography by using the former for colors and the latter for shading.
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html1372"
HREF="node31.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A>
<A NAME="tex2html1366"
HREF="node15.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A>
<A NAME="tex2html1360"
HREF="node29.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A>
<A NAME="tex2html1368"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>
<A NAME="tex2html1370"
HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html1373"
HREF="node31.html">4.16 Character escape sequences</A>
<B> Up:</B> <A NAME="tex2html1367"
HREF="node15.html">4. General features</A>
<B> Previous:</B> <A NAME="tex2html1361"
HREF="node29.html">4.14 Specifying area fill</A>
  <B> <A NAME="tex2html1369"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html1371"
HREF="node149.html">Index</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2001-04-18
</ADDRESS>
</BODY>
</HTML>
|