Coastlines and boarders

Plotting coastlines and boarders is handled by coast.

Shorelines

Use the -W parameter to plot only the shorelines:

gmt begin shorelines png
   gmt coast -Rg -JW15c -B -W
gmt end show
../../_images/67b8930e41c80cad1a26bc81920b6abe.png

The shorelines are divided in 4 levels:

  1. coastline

  2. lakeshore

  3. island-in-lake shore

  4. lake-in-island-in-lake shore

You can specify which level you want to plot by appending the level number and a GMT pen configuration to the -W parameter. For example, to plot just the coastlines with 0.5 thickness and black lines:

gmt begin shorelines_levels png
   gmt coast -Rg -JW15c -B -W1/0.5p,black
gmt end show
../../_images/c3e2e6daeacf8ad76a7b03408513b21a.png

You can specify multiple levels by using the -W parameter more than once:

gmt begin shorelines_levels png
   gmt coast -Rg -JW15c -B -W1/0.5p,black -W2/0.5,red
gmt end show
../../_images/580c6f3ad7f899c6733aa12f8765740c.png

Resolutions

The coastline database comes with 5 resolutions, which can be set using the -D parameter. The resolution drops by 80% between levels:

  1. c: crude

  2. l: low

  3. i: intermediate

  4. h: high

  5. f: full

oahu="-158.3/-157.6/21.2/21.8"
gmt begin shorelines_resolutions png
   for res in c, l, i, h, f
   do
       gmt coast -R${oahu} -JM5c -W1p -D${res} -X5c
   done
gmt end show
../../_images/2243b82b814295af096d16766b3b0a3e.png

Land and water

Use the -G and -S parameters to specify a fill color for land and water bodies. The colors can be given by name or hex codes:

gmt begin land_water png
   gmt coast -Rg -JW15c -B -G#666666 -Sskyblue
gmt end show
../../_images/ee98811b451efb0322440de72236cbb8.png