Next: 1.5 GMT Units Up: 1. SESSION ONE Previous: 1.3.4.1 Examples Contents Index

# 1.4 GMT Defaults

Numerous minor options (more than 50) can only be changed (temporarily) by modifying the GMT defaults settings. These settings control such aspects of GMT as font types and sizes, pen thickness used for basemaps, interpolants used when interpolation is needed and many more (Figures 1.2, 1.3, and 1.4 show the subset of parameters that affects plots). The GMT defaults reside in a file named .gmtdefaults. A user will typically have a ``master'' .gmtdefaults file in the home directory, and possibly more specialized .gmtdefaults files in certain sub-directories. If no such file exist in the current directory, GMT will attempt to open the user's master defaults file. If it is not present then the site-specific GMT defaults are used. These come preset from the GMT developers but may be modified prior to GMT installation. One typical change at this level is to select SI units rather than the default US/British units. It is recommended not to modify the system GMT defaults substantially since some applications may rely on the presence of a standard set of default values. Users may create a new .gmtdefaults file with the current GMT preset values using the gmtdefaults utility.

Figure 1.2: Some GMT parameters that affect plot appearance.

There are at least two good reasons why the GMT default options are placed in a separate parameter file:

1. It would not be practical to allow for command-line syntax covering so many options, many of which are rarely or never changed (such as the ellipsoid used for map projections).

2. It is convenient to keep separate .gmtdefaults files for specific projects, so that one may achieve a special effect simply by running GMT commands in a sub-directory whose .gmtdefaults file has the desired settings. For example, when making final illustrations for a journal article one must often standardize on font sizes and font types, etc. Keeping all those settings in a separate .gmtdefaults file simplifies this process. Likewise, GMT scripts that make slides often use a different color scheme and font size than output intended for laser printers. Organizing these various scenarios into separate .gmtdefaults files will minimize headaches associated with micro-editing of illustrations.

   Figure 1.3: More GMT parameters that affect plot appearance.

As mentioned, GMT programs will attempt to open a file named .gmtdefaults. At times it may be desirable to override that default action. As an alternative, we may supply another filename using the +filename syntax, i.e., on the same command line as the GMT command we append the name of the alternate .gmtdefaults file with the plus sign as a prefix. A perhaps less tedious method is to start each script with making a backup copy of the current .gmtdefaults (if one exists), then copy the desired .gmtdefaults file to the current directory, and finally undo the changes at the end of the script.

To change some of the GMT parameters on the fly inside a script the gmtset utility can be used. E.g., to change the annotation font to 12 point Times-Bold we run

`gmtset ANOT_FONT Times-Bold ANOT_FONT_SIZE 12p`

In addition to these 29 parameters that directly affect the plot there are numerous parameters that modify units, scales, etc. For a complete listing, see the gmtdefaults man pages.

Figure 1.4: Even more GMT parameters that affect plot appearance.

At the end of the script one can then reset the specific parameters back to their original values. We suggest that you go through all the available parameters at least once so that you know what is available to change via one of the proposed mechanisms.

Next: 1.5 GMT Units Up: 1. SESSION ONE Previous: 1.3.4.1 Examples Contents Index