Sophie

Sophie

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

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>2.2 Plotting text strings</TITLE>
<META NAME="description" CONTENT="2.2 Plotting text strings">
<META NAME="keywords" CONTENT="GMT_Tutorial">
<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_Tutorial.css">

<LINK REL="next" HREF="node39.html">
<LINK REL="previous" HREF="node34.html">
<LINK REL="up" HREF="node33.html">
<LINK REL="next" HREF="node39.html">
</HEAD>

<BODY  bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html927"
  HREF="node39.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html921"
  HREF="node33.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html915"
  HREF="node37.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html923"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html925"
  HREF="node63.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html928"
  HREF="node39.html">2.3 Exercises</A>
<B> Up:</B> <A NAME="tex2html922"
  HREF="node33.html">2. SESSION TWO</A>
<B> Previous:</B> <A NAME="tex2html916"
  HREF="node37.html">2.1.3 More exercises</A>
 &nbsp; <B>  <A NAME="tex2html924"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html926"
  HREF="node63.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION00420000000000000000">
2.2 Plotting text strings</A>
</H1>

<P>
In many situations we need to annotate plots or maps with text strings;
in <A NAME="tex2html149"
  HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> this is done using <A NAME="tex2html150"
  HREF="../man/pstext.html"><I><B>pstext</B></I></A><A NAME="2206"></A>.  Apart from the common
switches, there are 7 options that are particularly useful (Table&nbsp;<A HREF="#tbl:pstext">2.4</A>).

<P>
<BR><P></P>
<DIV ALIGN="CENTER"><A NAME="1589"></A>
<TABLE>
<CAPTION><STRONG>Table 2.4:</STRONG>
Some of the most frequently used options in <A NAME="tex2html139"
  HREF="../man/pstext.html"><I><B>pstext</B></I></A><A NAME="2220"></A>.</CAPTION>
<TR><TD>
<DIV ALIGN="CENTER"><TABLE CELLPADDING=3 BORDER="1">
<TR><TD ALIGN="CENTER" COLSPAN=1><FONT SIZE="-1">
<I>Option</I></FONT></TD>
<TD ALIGN="CENTER" COLSPAN=1><FONT SIZE="-1"> <I>Purpose</I></FONT></TD>
</TR>
<TR><TH ALIGN="LEFT"><FONT SIZE="-1">   
<B>-C</B></FONT><FONT SIZE="-1"><I>dx</I>/</FONT><FONT SIZE="-1"><I>dy</I> </FONT></TH>
<TD ALIGN="LEFT"><FONT SIZE="-1"> Spacing between text and the text box (see <B>-W</B>) </FONT></TD>
</TR>
<TR><TH ALIGN="LEFT"><FONT SIZE="-1">  
<B>-D</B></FONT><FONT SIZE="-1"><I>dx</I>/</FONT><FONT SIZE="-1"><I>dy</I> </FONT></TH>
<TD ALIGN="LEFT"><FONT SIZE="-1"> Offsets the projected location of the strings </FONT></TD>
</TR>
<TR><TH ALIGN="LEFT"><FONT SIZE="-1">  
<B>-G</B></FONT><FONT SIZE="-1"><I>fill</I> </FONT></TH>
<TD ALIGN="LEFT"><FONT SIZE="-1"> Sets the color of the text </FONT></TD>
</TR>
<TR><TH ALIGN="LEFT"><FONT SIZE="-1">  
<B>-L</B> </FONT></TH>
<TD ALIGN="LEFT"><FONT SIZE="-1"> Lists the font ids and exits </FONT></TD>
</TR>
<TR><TH ALIGN="LEFT"><FONT SIZE="-1">  
<B>-N</B> </FONT></TH>
<TD ALIGN="LEFT"><FONT SIZE="-1"> Deactivates clipping at the borders </FONT></TD>
</TR>
<TR><TH ALIGN="LEFT"><FONT SIZE="-1">  
<B>-S</B></FONT><FONT SIZE="-1"><I>pen</I> </FONT></TH>
<TD ALIGN="LEFT"><FONT SIZE="-1"> Selects outline font and sets pen attributes </FONT></TD>
</TR>
<TR><TH ALIGN="LEFT"><FONT SIZE="-1">  
<B>-W</B>[</FONT><FONT SIZE="-1"><I>fill</I>][</FONT><FONT SIZE="-1"><B>o</B>[</FONT><FONT SIZE="-1"><I>pen</I>]] </FONT></TH>
<TD ALIGN="LEFT"><FONT SIZE="-1"> Paint the text box; draw the outline if </FONT><FONT SIZE="-1"><B>o</B> is appended (also see <B>-C</B>) </FONT></TD>
</TR>
</TABLE><FONT SIZE="-1">

<A NAME="tbl:pstext"></A></FONT></DIV></TD></TR>
</TABLE>
</DIV><P></P>
<BR> 

<P>

<DIV ALIGN="CENTER"><A NAME="fig:GMT_pstext_clearance"></A><A NAME="2225"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 2.1:</STRONG>
Relationship between the text box and the extra clearance.</CAPTION>
<TR><TD>
<DIV ALIGN="CENTER"><IMG
 WIDTH="210" HEIGHT="82" ALIGN="BOTTOM" BORDER="0"
 SRC="img28.png"
 ALT="\includegraphics{scripts/GMT_pstext_clearance}"></DIV></TD></TR>
</TABLE>
</DIV>

<P>
The input data to <A NAME="tex2html151"
  HREF="../man/pstext.html"><I><B>pstext</B></I></A><A NAME="2230"></A> is expected to contain the following
information: 
<BR><A NAME="1590"></A>

<P>
<I>x   y   size   angle   fontno   justify   text</I> 
<BR>
<P>
The <I>size</I> argument is the font size in points, the <I>angle</I> is the
angle (measured counterclockwise) between the text's baseline and the
horizontal, <I>justify</I> indicates which point on the text-string should
correspond to the given <I>x, y</I> location, and <I>text</I> is the text
string or sentence to plot.  Figure&nbsp;<A HREF="#fig:GMT_pstext_justify">2.2</A> illustrates these concepts and shows
the relevant two-character codes used for justification.
<A NAME="973"></A>
<A NAME="974"></A>

<P>

<DIV ALIGN="CENTER"><A NAME="fig:GMT_pstext_justify"></A><A NAME="2240"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 2.2:</STRONG>
Justification (and corresponding character codes) for text strings.</CAPTION>
<TR><TD>
<DIV ALIGN="CENTER"><IMG
 WIDTH="241" HEIGHT="79" ALIGN="BOTTOM" BORDER="0"
 SRC="img29.png"
 ALT="\includegraphics{scripts/GMT_pstext_justify}"></DIV></TD></TR>
</TABLE>
</DIV>

<P>
The text string can be one or several words and may include octal codes for
special characters and escape-sequences used to select subscripts or symbol
fonts.  The escape sequences that are recognized by <A NAME="tex2html152"
  HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> are given in Tables&nbsp;<A HREF="#tbl:escape">2.5</A>
and&nbsp;<A HREF="#tbl:scand">2.6</A>.
<A NAME="979"></A>
<A NAME="980"></A>
<A NAME="981"></A>
<A NAME="982"></A>
<A NAME="983"></A>
<A NAME="984"></A>
<A NAME="985"></A>

<P>
<BR><P></P>
<DIV ALIGN="CENTER"><A NAME="999"></A>
<TABLE>
<CAPTION><STRONG>Table:</STRONG>
<A NAME="tex2html145"
  HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> text escape sequences.</CAPTION>
<TR><TD>
<DIV ALIGN="CENTER"><TABLE CELLPADDING=3 BORDER="1">
<TR><TD ALIGN="CENTER" COLSPAN=1><FONT SIZE="-1">
<I>Code</I></FONT></TD>
<TD ALIGN="CENTER" COLSPAN=1><FONT SIZE="-1">       <I>Effect</I></FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">  
@~</FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1">	Turns symbol font on or off </FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">   
@+	</FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1">	Turns superscript on or off </FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">   
@-	</FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1">	Turns subscript on or off </FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">   
@#	</FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1">	Turns small caps on or off </FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">   
@_	</FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1">	Turns underline on or off </FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">   
@%<I>fontno</I>%	</FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1">	Switches to another font; @%% resets to previous font </FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">   
@:<I>size</I>:	</FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1">	Switches to another font size; @:: resets to previous size </FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">   
@;<I>color</I>;	</FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1">	Switches to another font color; @;; resets to previous color </FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">   
@!	</FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1">	Creates one composite character of the next two characters </FONT></TD>
</TR>
<TR><TD ALIGN="LEFT"><FONT SIZE="-1">   
@@	</FONT></TD>
<TD ALIGN="LEFT"><FONT SIZE="-1">	Prints the @ sign itself </FONT></TD>
</TR>
</TABLE><FONT SIZE="-1">

<A NAME="tbl:escape"></A></FONT></DIV></TD></TR>
</TABLE>
</DIV><P></P>
<BR>

<P>
Note that these escape sequences (as well as octal codes) can be
used anywhere in <A NAME="tex2html153"
  HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> including in arguments to the <B>-B</B> option.
A chart of octal codes can be found in Appendix F in the <A NAME="tex2html154"
  HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> technical reference book.  For accented European characters you must
set <B>CHAR_ENCODING</B> to ISOLatin1 in your <U>.gmtdefaults4</U> file.

<P>
We will demonstrate <A NAME="tex2html155"
  HREF="../man/pstext.html"><I><B>pstext</B></I></A><A NAME="2259"></A> with the following script:

<P>
<PRE> 
cat &lt;&lt; EOF | pstext -R0/7/0/5 -Jx1i -P -B1g1 -GDarkOrange | ghostview -
1  1  30  0  4  BL It's P@al, not Pal!
1  2  30  0  4  BL Try @%33%ZapfChancery@%% today
1  3  30  0  4  BL @~D@~g@-b@- = 2@~pr@~G@~D@~h.
1  4  30  0  4  BL University of Hawaii at M@!a\225noa
EOF
</PRE>

<P>
<A NAME="1008"></A>

<P>
Here we have used the ``here document'' notation in <I>UNIX</I>: The <IMG
 WIDTH="16" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img30.png"
 ALT="$&lt;$"><IMG
 WIDTH="16" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img30.png"
 ALT="$&lt;$"> EOF
will treat the following lines as the input file until it detects the
word EOF.  We pipe the <I>PostScript</I> directly through <I>ghostview</I><A NAME="2265"></A> (the - tells
<I>ghostview</I><A NAME="2268"></A> that piping is happening).

<P>
<BR><P></P>
<DIV ALIGN="CENTER"><A NAME="1025"></A>
<TABLE>
<CAPTION><STRONG>Table 2.6:</STRONG>
Shortcuts for some European characters.</CAPTION>
<TR><TD>
<DIV ALIGN="CENTER"><TABLE CELLPADDING=3 BORDER="1">
<TR><TD ALIGN="LEFT"><I>Code</I></TD>
<TD ALIGN="LEFT"><I>Effect</I></TD>
<TD ALIGN="LEFT"><I>Code</I></TD>
<TD ALIGN="LEFT"><I>Effect</I></TD>
</TR>
<TR><TD ALIGN="LEFT">@E</TD>
<TD ALIGN="LEFT">&#198;</TD>
<TD ALIGN="LEFT">@e</TD>
<TD ALIGN="LEFT">&#230;</TD>
</TR>
<TR><TD ALIGN="LEFT">@O</TD>
<TD ALIGN="LEFT">&#216;</TD>
<TD ALIGN="LEFT">@o</TD>
<TD ALIGN="LEFT">&#248;</TD>
</TR>
<TR><TD ALIGN="LEFT">@A</TD>
<TD ALIGN="LEFT">&#197;</TD>
<TD ALIGN="LEFT">@a</TD>
<TD ALIGN="LEFT">&#229;</TD>
</TR>
<TR><TD ALIGN="LEFT">@C</TD>
<TD ALIGN="LEFT">&#199;</TD>
<TD ALIGN="LEFT">@c</TD>
<TD ALIGN="LEFT">&#231;</TD>
</TR>
<TR><TD ALIGN="LEFT">@N</TD>
<TD ALIGN="LEFT">&#209;</TD>
<TD ALIGN="LEFT">@n</TD>
<TD ALIGN="LEFT">&#241;</TD>
</TR>
<TR><TD ALIGN="LEFT">@U</TD>
<TD ALIGN="LEFT">&#220;</TD>
<TD ALIGN="LEFT">@u</TD>
<TD ALIGN="LEFT">&#252;</TD>
</TR>
<TR><TD ALIGN="LEFT">@s</TD>
<TD ALIGN="LEFT">&#223;</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
</TABLE>

<A NAME="tbl:scand"></A></DIV></TD></TR>
</TABLE>
</DIV><P></P>
<BR>

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html927"
  HREF="node39.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html921"
  HREF="node33.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html915"
  HREF="node37.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html923"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html925"
  HREF="node63.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html928"
  HREF="node39.html">2.3 Exercises</A>
<B> Up:</B> <A NAME="tex2html922"
  HREF="node33.html">2. SESSION TWO</A>
<B> Previous:</B> <A NAME="tex2html916"
  HREF="node37.html">2.1.3 More exercises</A>
 &nbsp; <B>  <A NAME="tex2html924"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html926"
  HREF="node63.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2010-01-14
</ADDRESS>
</BODY>
</HTML>