This site contains excerpts and examples of topics covered in the book. Available Now at Pragmatic Bookshelf!!
[View Contents] [Forum]
In our previous GMT examples we used a single command to create a simple globe and create an annotated map. In this example we will create a base map and then use the overlay feature of GMT to plot the location of volcanoes throughout the world.
The first step is to create the base map using pscoast:
pscoast -JN0/26 -R-180/180/-90/90 -W -G220/220/220 -S0/192/255 \ -N1 -B60g10 :."World Volcanoes": --PAPER_MEDIA=archA -K > world_volcanoes.eps
Here is a brief summary of the arguments used to create the base map:
(Many of these parameters are discussed in greater detail in the previous GMT posts---see links above.).
The -K allows us to create an overlay by issuing additional commands.
If we were to run pscoast without -K it would give us a nice base map:

Now that we have the base map command complete (don't forget the -K) we can add our overlay. For this we use a text file containing the locations of the volcanoes. The file format is simply longitude, latitude:
7.25,27.08 131.6,34.5 -67.62,-23.3 -90.876,14.501 ...
To create the overlay, we use the psxy command:
psxy volcano_xy.txt -JN -O -R -Sc0.15c -G255/0/0 >> world_volcanoes.eps
Notice that we redirect the output using >> to append to our world_volcanoes.eps file.
This gives us the completed map:

With psxy you can also draw line and polygons. Check out the GMT documentation for more details and be sure to see the previous blog posts on creating a simple globe and creating an annotated map.
The volcano locations used in this post are available here.
Comments
Great Book
Hi,
found your book by chance in a blog and ordered a copy: Very useful, I will use it in a geography course next year for students (16/17 years old, no prior knowledge of cartography/gis) although I still dont know what gis I will use qgis or kosmo gis ...
Btw: Are the data on your site in the public domain? E.g. may I use the volcano-file with other software, eveb commerical one, too?
Regards
Kurt
Data
All the data is in the public domain and licensing information, where applicable, is included in the download files. In short you can use anything as you see fit.