Sophie

Sophie

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

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>7.4 A 3-D perspective mesh plot</TITLE>
<META NAME="description" CONTENT="7.4 A 3-D perspective mesh plot">
<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="next" HREF="node125.html">
<LINK REL="previous" HREF="node123.html">
<LINK REL="up" HREF="node120.html">
<LINK REL="next" HREF="node125.html">
</HEAD>

<BODY  bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html4358"
  HREF="node125.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html4352"
  HREF="node120.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html4346"
  HREF="node123.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html4354"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html4356"
  HREF="node255.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html4359"
  HREF="node125.html">7.5 A 3-D illuminated</A>
<B> Up:</B> <A NAME="tex2html4353"
  HREF="node120.html">7. Creating GMT Graphics</A>
<B> Previous:</B> <A NAME="tex2html4347"
  HREF="node123.html">7.3 Spectral estimation and</A>
 &nbsp; <B>  <A NAME="tex2html4355"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html4357"
  HREF="node255.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION001540000000000000000"></A>
<A NAME="23747"></A>
<BR>
7.4 A 3-D perspective mesh plot
</H1>

<P>
This example will illustrate how to make a fairly complicated
composite figure.  We need a subset of the ETOPO5 bathymetry<A NAME="tex2html1323"
  HREF="footnode.html#foot23748"><SUP>7.1</SUP></A>and Geosat geoid data sets which we will extract from the local
data bases using <A NAME="tex2html1325"
  HREF="../man/grdraster.html"><I><B>grdraster</B></I></A><A NAME="24369"></A>.  We would like to show a
2-layer perspective plot where layer one shows a contour map
of the marine geoid with the location of the Hawaiian islands
superposed, and a second layer showing the 3-D mesh plot of
the topography.  We also add an arrow pointing north and some
text.  This is how to do it:

<P>
<BR CLEAR="ALL">
<HR>
<BR>
<PRE>#!/bin/sh
#               GMT EXAMPLE 04
#
# Purpose:      3-D mesh plot of Hawaiian topography and geoid
# GMT progs:    grdcontour, grdview, pscoast, pstext
# Unix progs:   echo, rm
#
ps=example_04.ps
echo '-10  255   0  255' &gt; zero.cpt
echo '  0  100  10  100' &gt;&gt; zero.cpt
grdcontour HI_geoid4.nc -Jm0.45i -E60/30 -R195/210/18/25 -C1 -A5+o -Gd4i -K -P -X1.5i -Y1.5i \
        -U/-1.25i/-1.25i/"Example 4 in Cookbook" &gt; $ps
pscoast -J -E60/30 -R -B2/2NEsw -Gblack -O -K -T209/19.5/1i &gt;&gt; $ps
grdview HI_topo4.nc -J -Jz0.34i -Czero.cpt -E60/30 -R195/210/18/25/-6/4 -N-6/lightgray -Qsm -O -K \
        -B2/2/2:"Topo (km)":neswZ -Y2.2i &gt;&gt; $ps
echo '3.25 5.75 60 0.0 33 BC H@#awaiian@# R@#idge' | pstext -R0/10/0/10 -Jx1i -O &gt;&gt; $ps
rm -f zero.cpt .gmt*
</PRE>
<BR CLEAR="ALL">
<HR>
<P>
The purpose of the color palette file <U>zero.cpt</U> is to have
the positive topography mesh painted light gray (the remainder
is white). The left side of Figure&nbsp;<A HREF="#fig:GMT_example_04">7.4</A> shows the complete illustration.

<P>

<DIV ALIGN="CENTER"><A NAME="fig:GMT_example_04"></A><A NAME="23756"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 7.4:</STRONG>
3-D perspective mesh plot (left) and colored version (right).</CAPTION>
<TR><TD><IMG
 WIDTH="335" HEIGHT="418" ALIGN="BOTTOM" BORDER="0"
 SRC="img158.png"
 ALT="\includegraphics[scale=0.42]{scripts/example_04}">
   <IMG
 WIDTH="335" HEIGHT="418" ALIGN="BOTTOM" BORDER="0"
 SRC="img159.png"
 ALT="\includegraphics[scale=0.42]{scripts/example_04c}"></TD></TR>
</TABLE>
</DIV>

<P>
A color version of this figure was used in our first article in <I>EOS
Trans. AGU</I> (Oct. 8th, 1991).  It was created along similar
lines, but instead of a mesh plot we chose a color-coded surface
with artificial illumination from a light-source due north.
We choose to use the <B>-Qi</B> option in <A NAME="tex2html1326"
  HREF="../man/grdview.html"><I><B>grdview</B></I></A><A NAME="24377"></A> to
achieve a high degree of smoothness.  Here, we select 100 dpi
since that will be the resolution of our final raster
(The EOS raster was 300 dpi). We used <A NAME="tex2html1327"
  HREF="../man/grdgradient.html"><I><B>grdgradient</B></I></A><A NAME="24382"></A> to
provide the intensity files.  The following script creates
the color <I>PostScript</I> file.  Note that the size of the
resulting output file is directly dependent on the square of
the dpi chosen for the scanline conversion.  A higher value
for dpi in <B>-Qi</B> would have resulted in a much larger
output file.  The cpt files were taken from Section&nbsp;<A HREF="node122.html#sec:example_02">7.2</A>.

<P>
<BR CLEAR="ALL">
<HR>
<BR>
<PRE>#!/bin/sh
#               GMT EXAMPLE 04c
#
# 3-D perspective color plot of Hawaiian topography and geoid
# GMT progs:    grdcontour, grdview, pscoast, pstext
# Unix progs:   echo, rm
#
ps=example_04c.ps
grdgradient HI_geoid4.nc -A0 -Gg_intens.grd -Nt0.75 -M
grdgradient HI_topo4.nc -A0 -Gt_intens.grd -Nt0.75 -M
grdview HI_geoid4.nc -Ig_intens.grd -JM6.75i -E60/30 -R195/210/18/25 -Cgeoid.cpt -Qi100 -K \
        -X1.5i -Y1.25i -P -U/-1.25i/-1i/"Example 04c in Cookbook" &gt; $ps
pscoast -J -E60/30 -R -B2/2NEsw -Gblack -O -K &gt;&gt; $ps
psbasemap -R -J -E60/30 -O -K -T209/19.5/1i --COLOR_BACKGROUND=red --TICK_PEN=thinner,red &gt;&gt; $ps
grdview HI_topo4.nc -It_intens.grd -J -JZ3.4i -Ctopo.cpt -E60/30 -R195/210/18/25/-6/4 \
        -N-6/lightgray -Qi100 -O -K -Y2.2i &gt;&gt; $ps
psbasemap -J -JZ3.4i -E60/30 -R -Z-6 -O -K -B2/2/2:"Topo (km)":neZ &gt;&gt; $ps
echo '3.25 5.75 60 0.0 33 BC H@#awaiian@# R@#idge' | pstext -R0/10/0/10 -Jx1i -O &gt;&gt; $ps
rm -f *_intens.grd .gmt*
</PRE>
<BR CLEAR="ALL">
<HR>
<P>
<A NAME="23766"></A>

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html4358"
  HREF="node125.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html4352"
  HREF="node120.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html4346"
  HREF="node123.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html4354"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html4356"
  HREF="node255.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html4359"
  HREF="node125.html">7.5 A 3-D illuminated</A>
<B> Up:</B> <A NAME="tex2html4353"
  HREF="node120.html">7. Creating GMT Graphics</A>
<B> Previous:</B> <A NAME="tex2html4347"
  HREF="node123.html">7.3 Spectral estimation and</A>
 &nbsp; <B>  <A NAME="tex2html4355"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html4357"
  HREF="node255.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2010-01-14
</ADDRESS>
</BODY>
</HTML>