Geography Reference
In-Depth Information
GMT and Multiple Commands
When you want to create a more complex map, you will wind
up running multiple GMT commands. The trick is to make sure
you specify in the first command that more PostScript code will
be appended to the output. Without this, you will end up with
every command generating a new page in the output. This can
be useful, but when you are trying to create an overlay of mul-
tiple commands, it's annoying. Create the base map using the
-K switch, and then in subsequent commands include the -O to
invoke overlay mode.
a new page in the output, and we would have to hold it up to the window
to see the overlay.
To add the overlay, we need two things: a text file containing the coor-
dinates of each point and the psxy command. Here is a snippet from the
text file we will use to create the map:
-4.0000000000,36.0000000000
-71.9146000000,42.8053750000
-122.7833300000,53.9176000000
5.6667000000,51.9667000000
-0.9519000000,51.4450000000
11.0800000000,46.0400000000
-124.0800000000,40.8800000000
These are just x and y values (longitude and latitude) for each point we
want to create on the map. To add these, we use psxy , making sure to
include the -O switch so the points overlay the base map. The complete
code to generate the base map and the overlay is as follows:
Download gmt_qgis_users.sh
pscoast -JN0/38 -R-180/180/-90/90 -K -W -G220/220/220 -S0/192/255 -N1 \
-P -B30g5:."Quantum GIS Users": > qgisusers.eps
psxy qgis_users.txt -JN -O -R -Sc0.15c -G255/0/0 >>qgisusers.eps
Note that in the psxy command we didn't need to supply any arguments
to the projection or extent switches since they were fully specified when
the base map was created. We included the overlay switch and a color
for the points using -G . The -Sc switch indicates we want to plot the
points using circles. There are several other symbol types you can use
including star, bar, diamond, and ellipse.
 
 
Search WWH ::




Custom Search