how to have Gmt

Choose the right version to add to your environement.

GMT 5.2.1 ‘compile from sources’

notes : en cours de test

versions

  • package gmt 5.2.1
  • package netcdf 4.4.1

environnement configuration

add this to your ‘.bashrc’ file :

############## GMT 5.2.1 'less os dependent'
export NETCDFHOME=/usr/local/NetCDF/netcdf-4.4.1/
export GMT_SHAREDIR=/usr/local/Gmt/gmt-5.2.1/share/
export GMTHOME=/usr/local/Gmt/gmt-5.2.1/
export PATH=$GMTHOME/bin:$PATH
##############

exemple

Copy past this inside a bash terminal.

export NETCDFHOME=/usr/local/NetCDF/netcdf-4.4.1
export GMT_SHAREDIR=/usr/local/Gmt/gmt-5.2.1/share
export GMTHOME=/usr/local/Gmt/gmt-5.2.1
export PATH=$GMTHOME/bin:$PATH

SCALE=18                   # make plot 15 cm across
LONMIN=-133. ; LONMAX=-60. # Longitude range of plots
LATMIN=20.  ; LATMAX=55.   # Latitude range of plots
OUTFILE=/tmp/usa.ps        # Output file

gmtset PS_MEDIA A4 FORMAT_GEO_MAP D
pscoast -R$LONMIN/$LONMAX/$LATMIN/$LATMAX -JM$SCALE -B10a20WSen -Dl -Na -A1000 -W2 -Y10 -X2 -P > /tmp/usa.ps
gs /tmp/usa.ps

GMT from ubuntu package

seems not to be exactly the same as official version

Version with Ubuntu 18.04 LTS

  • package gmt 5.4.3 [gmt gmt-doc gmt-examples gmt-tutorial gmt-gshhg gmt-gshhg-low]
  • package netcdf 4.6.0 [python-netcdf4 python3-netcdf4]

environnement configuration

Nothing to add to your ‘.bashrc’ file apparently.

exemple

Copy past this inside a bash terminal.

SCALE=18                   # make plot 15 cm across
LONMIN=-133. ; LONMAX=-60. # Longitude range of plots
LATMIN=20.  ; LATMAX=55.   # Latitude range of plots
OUTFILE=/tmp/usa.ps        # Output file

gmt gmtset PS_MEDIA A4 FORMAT_GEO_MAP D
gmt pscoast -R$LONMIN/$LONMAX/$LATMIN/$LATMAX -JM$SCALE -B10a20WSen -Dl -Na -A1000 -W2 -Y10 -X2 -P > /tmp/usa.ps
gs /tmp/usa.ps

GMT 4 ‘don’t use it anymore’

Note : don’t use this old version anymore

environnement configuration

############## GMT 4.5.7 'thanks to switch to GMT 5'
export NETCDFHOME=/usr/lib
export GMT_SHAREDIR=/usr/local/Gmt/gmt-4.5.7/share
export GMTHOME=/usr/local/Gmt/gmt-4.5.7
export PATH=$GMTHOME/bin:$PATH
##############

exemple

Copy past this inside a bash terminal.

export NETCDFHOME=/usr/lib
export GMT_SHAREDIR=/usr/local/Gmt/gmt-4.5.7/share
export GMTHOME=/usr/local/Gmt/gmt-4.5.7
export PATH=$GMTHOME/bin:$PATH

SCALE=18                   # make plot 15 cm across
LONMIN=-133. ; LONMAX=-60. # Longitude range of plots
LATMIN=20.  ; LATMAX=55.   # Latitude range of plots
OUTFILE=/tmp/usa.ps        # Output file

gmtset PAPER_MEDIA A4 PLOT_DEGREE_FORMAT D
pscoast -R$LONMIN/$LONMAX/$LATMIN/$LATMAX -JM$SCALE -B10a20WSen -Dl -Na -A1000 -W2 -Y10 -X2 -P > $OUTFILE
gs $OUTFILE