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
|
<!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>6.4 A 3-D perspective mesh plot</TITLE>
<META NAME="description" CONTENT="6.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 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="node78.html">
<LINK REL="previous" HREF="node76.html">
<LINK REL="up" HREF="node73.html">
<LINK REL="next" HREF="node78.html">
</HEAD>
<BODY bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html2108"
HREF="node78.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A>
<A NAME="tex2html2102"
HREF="node73.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A>
<A NAME="tex2html2096"
HREF="node76.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A>
<A NAME="tex2html2104"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>
<A NAME="tex2html2106"
HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2109"
HREF="node78.html">6.5 A 3-D illuminated</A>
<B> Up:</B> <A NAME="tex2html2103"
HREF="node73.html">6. Cook-book</A>
<B> Previous:</B> <A NAME="tex2html2097"
HREF="node76.html">6.3 Spectral estimation and</A>
  <B> <A NAME="tex2html2105"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html2107"
HREF="node149.html">Index</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H1><A NAME="SECTION001440000000000000000"></A>
<A NAME="10399"></A>
<BR>
6.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="tex2html382"
HREF="footnode.html#foot10400"><SUP>6.1</SUP></A>and Geosat geoid data sets which we will extract from the local
data bases using <A NAME="tex2html384"
HREF="../grdraster.html"><I><B>grdraster</B></I></A><A NAME="10409"></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>
<P>
<BR>
<P>
<BR CLEAR="ALL">
<HR>
<BR>
<PRE>
echo '-10 255 0 255' >! zero.cpt
echo '0 100 10 100' >> zero.cpt
grdcontour HI_geoid4.grd -Jm0.45i -E60/30 -R195/210/18/25 -C1 -A5 -G4i -K -P -X1.5i -Y1.5i \
-U/-1.25i/-1.25i/"Example 4 in Cookbook" >! example_04.ps
pscoast -Jm -E60/30 -R -B2/2NEsw -G0 -O -K >> example_04.ps
echo '205 26 0 0 1.1' | psxyz -Jm -E60/30 -R -SV0.2i/0.5i/0.4ii -W1p -O -K -N >> example_04.ps
echo '205 29.2 36 -90 1 5 N' | pstext -Jm -E60/30 -R -O -K -N >> example_04.ps
grdview HI_topo4.grd -Jm -Jz0.34i -Czero.cpt -E60/30 -R195/210/18/25/-6/4 -N-6/200/200/200 -Qsm -O -K \
-B2/2/2:"Topo (km)":neswZ -Y2.2i >> example_04.ps
echo '3.25 5.75 60 0.0 33 2 H@#awaiian@# R@#idge' | pstext -R0/10/0/10 -Jx1i -O >> example_04.ps
\rm -f zero.cpt
csh -f job4c.csh
</PRE>
<P>
<BR>
<BR>
<P>
<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). Figure <A HREF="node77.html#fig:GMT_example_04">6.4</A> shows the complete illustration.
<P></P>
<DIV ALIGN="CENTER"><A NAME="fig:GMT_example_04"></A><A NAME="10467"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 6.4:</STRONG>
3-D perspective mesh plot</CAPTION>
<TR><TD><IMG
WIDTH="399" HEIGHT="499" BORDER="0"
SRC="img101.gif"
ALT="\begin{figure}\centering\epsfig{figure=eps/GMT_example_04.eps}\end{figure}"></TD></TR>
</TABLE>
</DIV><P></P>
<P>
A color version of this figure was used in our first article in EOS
Trans. AGU (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="tex2html385"
HREF="../grdview.html"><I><B>grdview</B></I></A><A NAME="10473"></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="tex2html386"
HREF="../grdgradient.html"><I><B>grdgradient</B></I></A><A NAME="10482"></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 Example 2.
<P>
<P>
<BR>
<P>
<BR CLEAR="ALL">
<HR>
<BR>
<PRE>
grdgradient HI_geoid4.grd -A0 -Gg_intens.grd -Nt0.75 -M
grdgradient HI_topo4.grd -A0 -Gt_intens.grd -Nt0.75 -M
grdview HI_geoid4.grd -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 4c in Cookbook" >! example_4c.ps
pscoast -JM -E60/30 -R -B2/2NEsw -G0 -O -K >> example_4c.ps
echo '205 26 0 0 1.1' | psxyz -JM -E60/30 -R -SV0.2i/0.5i/0.4ii -W1p -G255/0/0 -O -K -N \
>> example_4c.ps
echo '205 29.2 36 -90 1 5 N' | pstext -JM -E60/30 -R -O -K -N >> example_4c.ps
grdview HI_topo4.grd -It_intens.grd -JM -JZ3.4i -Ctopo.cpt -E60/30 -R195/210/18/25/-6/4 \
-N-6/200/200/200 -Qi100 -O -K -Y2.2i >> example_4c.ps
psbasemap -JM -JZ3.4i -E60/30 -R -Z-6 -O -K -B2/2/2:"Topo (km)":neZ >> example_4c.ps
echo '3.25 5.75 60 0.0 33 2 H@#awaiian@# R@#idge' | pstext -R0/10/0/10 -Jx1i -O >> example_4c.ps
\rm -f *_intens.grd .gmtcommands
</PRE>
<P>
<BR>
<BR>
<P>
<BR CLEAR="ALL">
<HR>
<P>
<A NAME="10525"></A>
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html2108"
HREF="node78.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A>
<A NAME="tex2html2102"
HREF="node73.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A>
<A NAME="tex2html2096"
HREF="node76.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A>
<A NAME="tex2html2104"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>
<A NAME="tex2html2106"
HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2109"
HREF="node78.html">6.5 A 3-D illuminated</A>
<B> Up:</B> <A NAME="tex2html2103"
HREF="node73.html">6. Cook-book</A>
<B> Previous:</B> <A NAME="tex2html2097"
HREF="node76.html">6.3 Spectral estimation and</A>
  <B> <A NAME="tex2html2105"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html2107"
HREF="node149.html">Index</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2001-04-18
</ADDRESS>
</BODY>
</HTML>
|