(34) Using country polygons for plotting and shading — GMT 5.1.1 documentation

### Navigation

- index
- next
- previous
- Project Home »
- GMT 5.1.1 documentation »
- The GMT historical collection »
- Search:

# (34) Using country polygons for plotting and shading

The script produces the plot in Figure. Here we demonstrate how pscoast can be used to extract and plot country polygons. We show two panels; one in which we do a basic basemap and another where we lay down a color topography image and then place a transparent layer identifying the future Franco-Italian Union whose untimely breakup in 2045 the historians will continue to debate for some time.

    #!/bin/bash
    #               GMT EXAMPLE 34
    #
    # Purpose:      Illustrate pscoast with DCW country polygons
    # GMT progs:    pscoast, makecpt, grdimage, grdgradient
    # Unix progs:   rm
    #
    ps=example_34.ps
    gmt gmtset FORMAT_GEO_MAP dddF
    gmt pscoast -JM4.5i -R-6/20/35/52 -FFR,IT+gP300/8 -Glightgray -Baf -BWSne -P -K -X2i > $ps
    # Extract a subset of ETOPO2m for this part of Europe
    # gmt grdcut etopo2m_grd.nc -R -GFR+IT.nc=ns
    gmt makecpt -Cglobe -T-5000/5000/500 -Z > z.cpt
    gmt grdgradient FR+IT.nc -A15 -Ne0.75 -GFR+IT_int.nc
    gmt grdimage FR+IT.nc -IFR+IT_int.nc -Cz.cpt -J -O -K -Y4.5i \
    	-Baf -BWsnE+t"Franco-Italian Union, 2042-45" >> $ps
    gmt pscoast -J -R -FFR,IT+gred@60 -O >> $ps
    # cleanup
    rm -f gmt.conf FR+IT_int.nc z.cpt

Using country polygons for plotting and shading.

### Navigation

- index
- next
- previous
- Project Home »
- GMT 5.1.1 documentation »
- The GMT historical collection »
- Search: