(44) Map insetsΒΆ

In this example show how the two modules basemap and mapproject can be used to place map insets on top of your map. The map inset is usually intended for placing a smaller-scale version of the larger geographical context of your main plot, so that reader unfamiliar with the detailed map can see what region we are looking at. While the Australia example is simplest since we know the inset will be a square map, the Spain example requires us to compute the dimensions of the inset first, via mapproject, so that we can determine exact inset dimensions.

#!/usr/bin/env bash
#               GMT EXAMPLE 44
#
# Purpose:      Illustrate use of map insets
# GMT modules:  coast, basemap, mapproject
#

gmt begin ex44
	gmt subplot begin 2x1 -Fs6i/4i -B -BWSne
		gmt coast -R10W/5E/35N/44N -JM6i -EES+gbisque -Gbrown -Wfaint -N1/1p -Sazure1 -Df --FORMAT_GEO_MAP=dddF -c0
		gmt inset begin -DjTR+w2i/0.93i+o0.15i/0.1i -F+gwhite+p1p+c0.1c+s
			gmt coast -R15W/35E/30N/48N -JM? -Da -Gbrown -B0 -EES+gbisque --MAP_FRAME_TYPE=plain
		gmt inset end

		gmt coast -R110E/170E/44S/9S -JM6i -Wfaint -N2/1p -EAU+gbisque -Gbrown -Sazure1 -Da --FORMAT_GEO_MAP=dddF -c1
		gmt inset begin -DjTR+w1.5i+o0.15i/0.1i -F+gwhite+p1p+c0.1c+s
			gmt coast -Rg -JG120/30S/? -Da -Gbrown -A5000 -Bg -Wfaint -EAU+gbisque
		gmt inset end
	gmt subplot end
gmt end show
../_images/ex44.png

Map Insets.