Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 5764c67416561ab82b35afcf9c650e17 > files > 671

GMT-doc-4.5.2-1.fc13.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with LaTeX2HTML 2002-2-1 (1.71)
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>M.2 Labeled and non-equidistant color legends</TITLE>
<META NAME="description" CONTENT="M.2 Labeled and non-equidistant color legends">
<META NAME="keywords" CONTENT="GMT_Docs">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="GMT_Docs.css">

<LINK REL="previous" HREF="node235.html">
<LINK REL="up" HREF="node234.html">
<LINK REL="next" HREF="node237.html">
</HEAD>

<BODY  bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html5985"
  HREF="node237.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html5979"
  HREF="node234.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html5975"
  HREF="node235.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html5981"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html5983"
  HREF="node255.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html5986"
  HREF="node237.html">N. Custom Plot Symbols</A>
<B> Up:</B> <A NAME="tex2html5980"
  HREF="node234.html">M. Of colors and</A>
<B> Previous:</B> <A NAME="tex2html5976"
  HREF="node235.html">M.1 Built-in color palette</A>
 &nbsp; <B>  <A NAME="tex2html5982"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html5984"
  HREF="node255.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION003020000000000000000"></A>
<A NAME="app:colorbars"></A><A NAME="32448"></A>
<BR>
M.2 Labeled and non-equidistant color legends
</H1>
The use of color legends has already been introduced in Chapter&nbsp;<A HREF="node120.html#ch:7">7</A> (examples 2, 16, and 17). Things become a bit more complicated when you want to label the legend with names for certain intervals (like geological time periods in the example below). To accomplish that, one should add a semi-colon and the label name at the end of a line in the cpt table and add the <B>-L</B> option to the <A NAME="tex2html1884"
  HREF="../man/psscale.html"><I><B>psscale</B></I></A><A NAME="32484"></A> command that draws the color legend. This option also makes all intervals in the legend of equal length, even it the numerical values are not equally spaced.

<P>
Normally, the name labels are plotted at the lower end of the intervals. But by adding a <I>gap</I> amount (even when zero) to the <B>-L</B> option, they are centered. The example below also shows how to annotate ranges using <B>-Li</B> (in which case no name labels should appear in the cpt file), and how to switch the color bar around (by using a negative length).

<P>
<BR CLEAR="ALL">
<HR>
<BR>
<PRE>#!/bin/sh
#
ps=GMT_App_M_2.ps

gmtset ANNOT_FONT_SIZE 10p MEASURE_UNIT cm

# Set up color palette with named annotations

cat &gt; ages.cpt &lt;&lt;END
#COLOR_MODEL = RGB
#
0       197     0       255     23      197     0       255     ;Neogene
23      81      0       255     66      81      0       255     ;Paleogene
66      0       35      255     146     0       35      255     ;Cretaceous
146     0       151     255     200     0       151     255     ;Jurassic
200     0       255     244     251     0       255     244     ;Triassic
251     0       255     127     299     0       255     127     ;Permian
299     0       255     11      359     0       255     11      ;Carboniferous
359     104     255     0       416     104     255     0       ;Devonian
416     220     255     0       444     220     255     0       ;Silurian
444     255     174     0       488     255     174     0       ;Ordovician
488     255     58      0       542     255     58      0       ;Cambrian
B       black
F       white
END

# Top row, left to right. Using names.
psscale -Ef -Cages.cpt  -D00/13/-8/0.5    -K         &gt; $ps
psscale -Ef -Cages.cpt  -D04/13/-8/0.5 -O -K -L     &gt;&gt; $ps
psscale -Ef -Cages.cpt  -D08/13/-8/0.5 -O -K -L0.0  &gt;&gt; $ps
psscale -Ef -Cages.cpt  -D12/13/-8/0.5 -O -K -L0.1  &gt;&gt; $ps
psscale -Ef -Cages.cpt  -D16/13/+8/0.5 -O -K -L     &gt;&gt; $ps
psscale -Ef -Cages.cpt  -D20/13/+8/0.5 -O -K -L0.1  &gt;&gt; $ps

# Bottom row, left to right. Using numbers.
sed 's/;.*$//' ages.cpt &gt; years.cpt
psscale -Ef -Cyears.cpt -D00/04/+8/0.5 -O -K        &gt;&gt; $ps
psscale -Ef -Cyears.cpt -D04/04/-8/0.5 -O -K -L     &gt;&gt; $ps
psscale -Ef -Cyears.cpt -D08/04/-8/0.5 -O -K -L0.0  &gt;&gt; $ps
psscale -Ef -Cyears.cpt -D12/04/-8/0.5 -O -K -L0.1  &gt;&gt; $ps
psscale -Ef -Cyears.cpt -D16/04/-8/0.5 -O -K -Li    &gt;&gt; $ps
psscale -Ef -Cyears.cpt -D20/04/-8/0.5 -O    -Li0.1 &gt;&gt; $ps

rm -f ages.cpt years.cpt
</PRE>
<BR CLEAR="ALL">
<HR>
<P>

<DIV ALIGN="CENTER"><A NAME="fig:GMT_App_M_2"></A><A NAME="32461"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure M.2:</STRONG>
The many forms of color legends created by <A NAME="tex2html1881"
  HREF="../man/psscale.html"><I><B>psscale</B></I></A><A NAME="32492"></A>.</CAPTION>
<TR><TD>
<DIV ALIGN="CENTER"><IMG
 WIDTH="556" HEIGHT="428" ALIGN="BOTTOM" BORDER="0"
 SRC="img288.png"
 ALT="\includegraphics[width=\textwidth]{scripts/GMT_App_M_2}">
</DIV></TD></TR>
</TABLE>
</DIV>


<HR>
<!--Navigation Panel-->
<A NAME="tex2html5985"
  HREF="node237.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html5979"
  HREF="node234.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html5975"
  HREF="node235.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html5981"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html5983"
  HREF="node255.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html5986"
  HREF="node237.html">N. Custom Plot Symbols</A>
<B> Up:</B> <A NAME="tex2html5980"
  HREF="node234.html">M. Of colors and</A>
<B> Previous:</B> <A NAME="tex2html5976"
  HREF="node235.html">M.1 Built-in color palette</A>
 &nbsp; <B>  <A NAME="tex2html5982"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html5984"
  HREF="node255.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2010-01-14
</ADDRESS>
</BODY>
</HTML>