File: node93.html

package info (click to toggle)
gmt-doc 3.4-1.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,756 kB
  • ctags: 1,800
  • sloc: makefile: 30
file content (419 lines) | stat: -rw-r--r-- 12,901 bytes parent folder | download | duplicates (2)
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
<!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.20 Custom map symbols</TITLE>
<META NAME="description" CONTENT="6.20 Custom map symbols">
<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="previous" HREF="node92.html">
<LINK REL="up" HREF="node73.html">
<LINK REL="next" HREF="node94.html">
</HEAD>

<BODY  bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html2330"
  HREF="node94.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A> 
<A NAME="tex2html2324"
  HREF="node73.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A> 
<A NAME="tex2html2320"
  HREF="node92.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A> 
<A NAME="tex2html2326"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A> 
<A NAME="tex2html2328"
  HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html2331"
  HREF="node94.html">7. Mailing lists, updates,</A>
<B> Up:</B> <A NAME="tex2html2325"
  HREF="node73.html">6. Cook-book</A>
<B> Previous:</B> <A NAME="tex2html2321"
  HREF="node92.html">6.19 Color patterns on</A>
 &nbsp <B>  <A NAME="tex2html2327"
  HREF="node1.html">Contents</A></B> 
 &nbsp <B>  <A NAME="tex2html2329"
  HREF="node149.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION0014200000000000000000"></A>
<A NAME="12095"></A>
<BR>
6.20 Custom map symbols
</H1>

<P>
One is often required to make special maps that shows the
distribution of certain features but one would prefer to
use a custom symbol instead of the built-in circles,
squares, triangles, etc. in the <A NAME="tex2html483"
  HREF="http://www.soest.hawaii.edu/gmt"><B>GMT</B></A> plotting programs
<A NAME="tex2html484"
  HREF="../psxy.html"><I><B>psxy</B></I></A><A NAME="12136"></A> and <A NAME="tex2html485"
  HREF="../psxyz.html"><I><B>psxyz</B></I></A><A NAME="12145"></A>.  Here we demonstrate one
approach that allows for a fair bit of flexibility in
designing ones own symbols.  The following recipe is used
when designing a new symbol. (1) Use <A NAME="tex2html486"
  HREF="../psbasemap.html"><I><B>psbasemap</B></I></A><A NAME="12154"></A> (or
engineering paper!) to set up an empty grid that goes from
-0.5 to +0.5 in both <I>x</I> and <I>y</I>.  Use ruler and
compass to draw your new symbol using straight lines and
arcs of circles.  This is how your symbol will look when
a size of 1 inch is chosen.  Figure&nbsp;<A HREF="node93.html#fig:GMT_volcano">6.20</A> illustrates a
new symbol we will call volcano.

<P>

<P></P>
<DIV ALIGN="CENTER"><A NAME="fig:GMT_volcano"></A><A NAME="12163"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 6.20:</STRONG>
Making a new volcano symbol for <A NAME="tex2html477"
  HREF="http://www.soest.hawaii.edu/gmt"><B>GMT</B></A></CAPTION>
<TR><TD><IMG
 WIDTH="299" HEIGHT="268" BORDER="0"
 SRC="img126.gif"
 ALT="\begin{figure}\centering\epsfig{figure=eps/GMT_volcano.eps}\end{figure}"></TD></TR>
</TABLE>
</DIV><P></P>

<P>
(2) After designing the symbol we will encode it using a
simple set of rules.  In our case we describe our volcano
using no more than 4 possible constructs:

<P>
<PRE><TT>
 
<P>

<P>
<IMG
 WIDTH="18" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img127.gif"
 ALT="$x_0$"> <IMG
 WIDTH="18" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img128.gif"
 ALT="$y_0$"> <B>M</B> [ <B>-G</B><I>fill</I> ] [ <B>-W</B><I>pen</I> ] 		 Startnew element at <IMG
 WIDTH="18" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img127.gif"
 ALT="$x_0$">, <IMG
 WIDTH="18" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img128.gif"
 ALT="$y_0$"> 
<BR><P>
<IMG
 WIDTH="18" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img129.gif"
 ALT="$x_1$"> <IMG
 WIDTH="18" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img130.gif"
 ALT="$y_1$"> <B>D</B> 		 Draw straight line from current point to <IMG
 WIDTH="18" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img129.gif"
 ALT="$x_1$">, <IMG
 WIDTH="18" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img130.gif"
 ALT="$y_1$"> 
<BR><P>
<IMG
 WIDTH="18" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img127.gif"
 ALT="$x_0$"> <IMG
 WIDTH="18" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img128.gif"
 ALT="$y_0$"> <IMG
 WIDTH="11" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
 SRC="img131.gif"
 ALT="$r$"> <IMG
 WIDTH="24" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img132.gif"
 ALT="$\Delta\alpha$"> <B>C</B> [ <B>-G</B><I>fill</I> ] [ <B>-W</B><I>pen</I> ] 		 Drawsingle circle of radius <IMG
 WIDTH="11" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
 SRC="img131.gif"
 ALT="$r$"> around <IMG
 WIDTH="18" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img127.gif"
 ALT="$x_0$">, <IMG
 WIDTH="18" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img128.gif"
 ALT="$y_0$"> in steps of <IMG
 WIDTH="24" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img132.gif"
 ALT="$\Delta\alpha$"><IMG
 WIDTH="11" HEIGHT="15" ALIGN="BOTTOM" BORDER="0"
 SRC="img61.gif"
 ALT="$^{o}$">
<BR><P>
<IMG
 WIDTH="18" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img127.gif"
 ALT="$x_0$"> <IMG
 WIDTH="18" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img128.gif"
 ALT="$y_0$"> <IMG
 WIDTH="11" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
 SRC="img131.gif"
 ALT="$r$"> <IMG
 WIDTH="21" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img133.gif"
 ALT="$\alpha_1$"> <IMG
 WIDTH="21" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img134.gif"
 ALT="$\alpha_2$"> <IMG
 WIDTH="24" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img132.gif"
 ALT="$\Delta\alpha$"> <B>A</B> 		 Drawarc segment of radius <IMG
 WIDTH="11" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
 SRC="img131.gif"
 ALT="$r$"> from angle <IMG
 WIDTH="21" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img133.gif"
 ALT="$\alpha_1$"> to <IMG
 WIDTH="21" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img134.gif"
 ALT="$\alpha_2$">every <IMG
 WIDTH="24" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
 SRC="img132.gif"
 ALT="$\Delta\alpha$"><IMG
 WIDTH="11" HEIGHT="15" ALIGN="BOTTOM" BORDER="0"
 SRC="img61.gif"
 ALT="$^{o}$">
<P>

</TT></PRE> 

<P>
The optional <B>-G</B> and <B>-W</B> can be used to hardwire
the color fill and pen for segments.  By default the segments
are painted based on the values of the command line settings.

<P>
Manually applying these rules to our symbol results in a
definition file <U>volcano.def</U>:

<P>

<P>

<BR>

<P>
<BR CLEAR="ALL">
<HR>
<BR>
<PRE>
-0.5    -0.5    M
-0.2    0    D
-0.1    0.173205081    0.2    240    300    2    A
0    0    D
0.3    -0.5    D
-0.05    0.15    0.1    5    C
0.15    0.3    0.075    5    C
0.325    0.4    0.05    10    C
0.45    0.45    0.025    10    C
</PRE>

<P>
<BR>

<BR>

<P>
<BR CLEAR="ALL">
<HR>
<P>
The values refer to positions and dimensions illustrated
in Figure&nbsp;<A HREF="node93.html#fig:GMT_volcano">6.20</A> above.  (3) Given a proper
definition file we use the supplied <I>$AWK</I><A NAME="12359"></A>-script <U>make_symbol</U>
to create a custom <I>$AWK</I><A NAME="12365"></A>-script that will read locations and
sizes of the desired symbols and replace them with line-drawings
like the one in the figure but translated and scaled accordingly.
The output is a multi-segment file (see Appendix B) which may
be plotted with <A NAME="tex2html487"
  HREF="../psxy.html"><I><B>psxy</B></I></A><A NAME="12371"></A> or <A NAME="tex2html488"
  HREF="../psxyz.html"><I><B>psxyz</B></I></A><A NAME="12380"></A>.

<P>
We are now ready to give it a try.  Based on the hotspot
locations in the file <U>hotspots.d</U> (with a 3rd column
giving the desired symbol sizes in inches) we lay down a
world map and overlay red volcano symbols using our custom-built
<I>$AWK</I><A NAME="12389"></A>-script <U>volcano.awk</U> and <A NAME="tex2html489"
  HREF="../psxy.html"><I><B>psxy</B></I></A><A NAME="12396"></A>.
Note that you must first transform the coordinates using
<A NAME="tex2html490"
  HREF="../mapproject.html"><I><B>mapproject</B></I></A><A NAME="12405"></A> prior to running the <I>$AWK</I><A NAME="12413"></A>-script.
Without further discussion we also make a definition for a multi-
colored bulls-eye symbol:

<P>

<P>

<BR>

<P>
<BR CLEAR="ALL">
<HR>
<BR>
<PRE>
0    -0.7    M    -W0.5p/255/0/0p
0    0.7    D
-0.7    0    M    -W0.5p/255/0/0p
0.7    0    D
0    0    0.45    5    C    -Gp0/12
0    0    0.45    5    C    -W0.25p
0    0    0.35    5    C    -G255/255/0 -W0.25p
0    0    0.25    5    C    -Gp0/9
0    0    0.25    5    C    -W0.25p
0    0    0.15    5    C    -G255/255/0 -W0.25p
0    0    0.05    5    C    -G255 -W0.25p
</PRE>

<P>
<BR>

<BR>

<P>
<BR CLEAR="ALL">
<HR>
<P>
Here is our final map script:

<P>

<P>

<BR>

<P>
<BR CLEAR="ALL">
<HR>
<BR>
<PRE>
$AWK -f make_symbol &lt; volcano.def &gt;! volcano.awk
$AWK -f make_symbol &lt; bullseye.def &gt;! bullseye.awk
cat &lt;&lt; EOF &gt;! hotspots.d
55.5    -21.0    0.25
63.0    -49.0    0.25
-12.0    -37.0    0.25
-28.5    29.34    0.25
48.4    -53.4    0.25
155.5    -40.4    0.25
-155.5    19.6    0.5
-138.1    -50.9    0.25
-153.5    -21.0    0.25
-116.7    -26.3    0.25
-16.5    64.4    0.25
EOF
pscoast -R0/360/-90/90 -JR180/9i -B60/30:."Hotspot Islands and Cities": -G0/150/0 -S200/200/255 \
   -Dc -A5000 -K -U"Example 20 in Cookbook" &gt;! example_20.ps
mapproject -R0/360/-90/90 -JR -Di hotspots.d | $AWK -f volcano.awk | psxy -R0/9/0/9 -Jx1i -O -K \
   -M -W0.25p -G255/0/0 -L &gt;&gt; example_20.ps
cat &lt;&lt; EOF &gt;! cities.d
286    40.45    0.8
31.15    30.03    0.8
115.49    -31.58    0.8
EOF
mapproject -R0/360/-90/90 -JR -Di cities.d | $AWK -f bullseye.awk | psxy -R0/9/0/9 -Jx -O \
   -M &gt;&gt; example_20.ps
\rm -f volcano.awk bullseye.awk hotspots.d cities.d
</PRE>

<P>
<BR>

<BR>

<P>
<BR CLEAR="ALL">
<HR>
<P>
which produces the plot in Figure&nbsp;<A HREF="node93.html#fig:GMT_example_20">6.21</A>.

<P>

<P></P>
<DIV ALIGN="CENTER"><A NAME="fig:GMT_example_20"></A><A NAME="12470"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 6.21:</STRONG>
Using custom symbols in <A NAME="tex2html480"
  HREF="http://www.soest.hawaii.edu/gmt"><B>GMT</B></A></CAPTION>
<TR><TD><IMG
 WIDTH="554" HEIGHT="410" BORDER="0"
 SRC="img135.gif"
 ALT="\begin{figure}\centering\epsfig{figure=eps/GMT_example_20.eps}\end{figure}"></TD></TR>
</TABLE>
</DIV><P></P>

<P>
Given these guidelines you can easily make your own symbols.
Symbols with more than one color can be obtained by making
several symbol components.  E.g., to have yellow smoke coming
out of red volcanoes we would make two symbols: one with just
the cone and caldera and the other with the bubbles.  These
would be plotted consecutively using the desired colors.
Alternatively, like in <U>bullseye.def</U>, we may
specify colors directly for the various segments.  Note that
the custom symbols, unlike the built-in symbols in <A NAME="tex2html491"
  HREF="http://www.soest.hawaii.edu/gmt"><B>GMT</B></A>, can
be used with the built-in patterns (Appendix E).  Other
approaches are also possible, of course.
<A NAME="12467"></A>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html2330"
  HREF="node94.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A> 
<A NAME="tex2html2324"
  HREF="node73.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A> 
<A NAME="tex2html2320"
  HREF="node92.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A> 
<A NAME="tex2html2326"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A> 
<A NAME="tex2html2328"
  HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html2331"
  HREF="node94.html">7. Mailing lists, updates,</A>
<B> Up:</B> <A NAME="tex2html2325"
  HREF="node73.html">6. Cook-book</A>
<B> Previous:</B> <A NAME="tex2html2321"
  HREF="node92.html">6.19 Color patterns on</A>
 &nbsp <B>  <A NAME="tex2html2327"
  HREF="node1.html">Contents</A></B> 
 &nbsp <B>  <A NAME="tex2html2329"
  HREF="node149.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2001-04-18
</ADDRESS>
</BODY>
</HTML>