First plot using GMT: A topographic map

Topographic map

A topographic map basically gives the variation in elevation of a region. The elevation of the landscape being measured above or below a reference surface, which is usually the mean sea level. Different color schemes can be used to represent the topographic variation. The data used to prepare topographic map are in some grid forms.

Map structure

The first plot start with GMT, we can prepare the topographic map. This map will have a border in latitude and longitude. Also we will add coastlines and a colorbar to show the variation in the topography.

The below map we are going to prepare today.
Topography of Sunda

Map features in code

The main features used in this map are perpared with the GMT modules:
basemap, grdgradient, grdimage, coast and colorbar

In order to utilize the above modules following arguments are also used

-B    :    Used for tick marks, annotations, and labels for basemaps and axes
-J     :    Used to select a map projection
-R    :    Used to define the extent of the map region
-A    :    Used to set Azimuthal direction for a directional derivative
-C    :    Used to add a cpt
-D    :    Used to define the reference point on the map

Data to be used

For this map we are using the Global Earth Relief Grids data provided by GMT. To access the grid we specify the special name @earth_relief_01m. While using this data set we specify the region arguments also to limit the data volume.

Code section

For windows operating system, we can use notepad to create a txt file and then saving it with .bat extension. Once the file with all necessary codes is prepared we can simply double click it to run the file and it will execute all the GMT code at once.

The following gmt script was used to create the map.
gmt begin topography png

gmt basemap -R85/125/-15/5 -JM6i -BWSne -Ba5f5

gmt grdgradient @earth_relief_01m -R85/125/-15/5 -A225 -Ne0.8 -Gshadow.grd

gmt grdimage @earth_relief_01m -R85/125/-15/5 -JM6i -Cglobe -Ishadow.grd

gmt coast -R85/125/-15/5 -JM6i -W0.1p,black

gmt colorbar -Cglobe -R85/125/-15/5 -Dx16/3.8/7.8/0.5 -Bxa2500f -By+lm

gmt end
pause

Thank you for visiting us.