CLI tool
GenericMappingTools/gmt avatar
GenericMappingTools/gmt

GMT: a hundred command line tools for map and data illustration

The Generic Mapping Tools

986 stars414 forksCNOASSERTION

At a glance

What is it?
The Generic Mapping Tools is a collection of about 100 command line programs for filtering, trend fitting, gridding and projecting geographic and Cartesian data, plus a supplements package with around 50 more specialised tools and support for more than 30 map projections. It is LGPL v3, it has been maintained since 1991, and it expects you to download its coastline and elevation data separately.
Who is it for?
GMT is the right tool for a geoscientist, oceanographer or planetary scientist who needs publication quality figures from command line data, and for anyone who wants the same plot in a script, in a paper and in a slide without a graphics session. It is the wrong tool if you want a single library API in one language, if you cannot host the support data next to the programs, or if you are on a platform the project only supports through an emulator or a virtual machine.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly C, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A workflow of separate programs, not one library

GMT is an open source collection of about 100 command line tools for manipulating geographic and Cartesian data sets, including filtering, trend fitting, gridding and projecting, and for producing high quality illustrations. The range of output runs from simple x-y plots through contour maps to artificially illuminated surfaces, 3D perspective views and animations. The supplements add another 50 more specialised and discipline specific tools, and the library supports over 30 map projections and transformations. What this means in practice is that a figure in GMT is often a chain of small programs, each doing one transformation, with the intermediate files passed along. That is a different shape from a plotting library, and it is the shape that makes GMT scriptable and reproducible: a figure is a shell pipeline you can rerun on a new data file. The trade-off is a learning curve, because the options of each program are terse and there is a lot of surface area, and the README says as much when it lists the fields in which GMT is used, from earth, ocean and planetary science through to medical research, physics, mathematics, fisheries institutes, oil companies, government agencies and hobbyists.

Coastlines and elevations ship as separate downloads

The first thing that surprises people is that the program and its map data are not one thing. GMT needs support data such as GSHHG coastlines, rivers and political boundaries, and it can optionally use DCW country polygons. The install section names three archives, of which the third is optional: gmt-6.x.x.tar.gz is the GMT 6 distribution, gshhg-gmt-2.x.x.tar.gz carries all five resolutions of the GSHHG coastline data, and dcw-gmt-2.x.x.tar.gz is the Digital Chart of the World polygon data. All five GSHHG resolutions are worth having, since the resolution you draw at depends on the scale of the figure, and a coastline that is too coarse shows up as visible faceting on a regional map. The same pattern applies to the raster side, and the README lists the sources GMT uses or can access, including the Earth 15 arc-second IGPP and GEBCO elevation models, the Earth 1 arc-second SRTM elevation model and the 15 arc-second GSHHG land and sea masks, crustal age, Blue Marble and Black Marble imagery, geoid anomalies, free-air gravity anomalies, vertical gravity gradients, and the EMAG2 and WDMAM magnetic anomaly grids. The repository carries a.dvc directory, which is a data version control tool, so the data side is managed rather than dumped into a wiki.

Installing: three tar archives, two installers, and a build from source

GMT has been installed successfully under UNIX, Linux, macOS, FreeBSD and OpenBSD on workstations, and it also installs under Windows and in UNIX emulators such as Cygwin or on virtual machines. For macOS and Windows there are separate installers, and the project expects few problems on other platforms. You can obtain GMT and the support data from the main site, and there are two documented paths: the install instructions for installing the package, and BUILDING.md for building it from the sources. The build is a CMake project, with a CMakeLists.txt at the root and cmake, src, share, doc, test, ci and admin directories around it. The separate test directory and the Tests workflow badge, alongside codecov and Coverity scans, tell you that this is a codebase with a test suite rather than a collection of scripts, and the .dvc setup means the test data is versioned as well. The two paths lead to different routines: the installer gives you a working tree in minutes, while the source route means configuring a C project with a long dependency list.

The dependency list explains what GMT can and cannot do

GMT relies on a set of other open source libraries, programs and data, and the README acknowledges them one by one, marking the optional ones with an asterisk. The mandatory ones include netCDF for the data formats and GDAL for geospatial translation. The optional ones are PCRE for regular expressions, FFTW for fast Fourier transforms, LAPACK and BLAS for linear algebra, GLIB and ZLIB. The list of external programs GMT may call is a better guide to its behaviour than the library list, because it tells you what happens on the final rendering step: GDAL through ogr2ogr and gdal_translate, Ghostscript, FFmpeg, xdg-open and GraphicsMagick. FFmpeg in particular explains how the animation output is produced, and Ghostscript explains the PostScript path for figures that go into a paper. GMT also provides several colour maps of its own. For an institution deciding whether to standardise on it, the practical question is which of these are already present, because the install is only as good as the weakest optional dependency you actually need.

The licence is LGPL v3, and citing GMT is part of using it

GMT is released under the GNU Lesser General Public License version 3 or any later version, with the copyright held by the GMT Team from 1991 to 2026. The repository carries both the LGPL and the GPLv3 licence texts, and GitHub's own classifier does not recognise the combination, so the file to read is LICENSE.TXT. For software that links against GMT libraries, the LGPL structure matters, because that is the mechanism by which the licence stays permissive for the caller while requiring that modifications to the library itself be shared. That is a question for your own legal review, not for this page, but the shape of it is worth knowing before you build a proprietary tool on top of the library. The citation request is in the same spirit. The README asks that you consider including the project's article in the reference list of future publications that benefit from GMT, giving the full reference to the 2019 paper in Geochemistry, Geophysics, Geosystems, and the project carries both a Zenodo DOI badge and a CITATION.cff file so that automated citation tooling has something to read.

Bugs go to the tracker, questions go to the forum

The support model is stated with unusual honesty. You have not bought anything, so you cannot expect full service. What you get instead is a clear routing rule: if you find a bug in any of the programs, report it by opening an issue rather than trying to fix it yourself, so that the fix can reach other users too, and make sure to provide enough information for the problem to be recreated. General questions belong on the GMT Community Forum. Behind that sits the governance, since GMT is developed and maintained by the GMT Team with help from a global set of contributors listed in THANKS.md, and with support from the National Science Foundation. The Contributor Covenant badge in the readme points at the same commitment on the conduct side. The last push was on 2026-10-20, and the release history is a slow, major version cadence: 6.5.0 in January 2024, 6.6.0 in July 2025, and 6.7.0 on 2026-07-30. That is the pattern of a project that changes in large, well tested increments rather than weekly.

Where GMT is the wrong tool

Three limits are worth naming. The first is the shape of the interface. A single library with one calling convention is easier to learn than a hundred programs with terse option sets, and a team whose plotting lives in Python will find GMT's pipeline model an extra thing to maintain, even though the output quality and scriptability are better for scientific figures. The second is data. The support archives are not small, they have to be fetched separately from the program, and every figure that draws a coastline depends on having them in the right place. The third is platform coverage, where macOS and Windows have their own installers and Windows users are otherwise pointed at Cygwin or a virtual machine, which is a workable but awkward path. On the other side of the ledger, the longevity is real: a tool that has been maintained since 1991, is used in fisheries institutes and oil companies and government agencies, and has a user forum, is a low risk for a long lived analysis pipeline.

Editorial conclusion

GMT is the right tool for a geoscientist, oceanographer or planetary scientist who needs publication quality figures from command line data, and for anyone who wants the same plot in a script, in a paper and in a slide without a graphics session. It is the wrong tool if you want a single library API in one language, if you cannot host the support data next to the programs, or if you are on a platform the project only supports through an emulator or a virtual machine. Before you start, download the GSHHG archive as well as the main distribution, read the install instructions rather than the build ones, and register the Zenodo DOI when you publish so the software gets the credit.

Frequently asked questions

What is the Generic Mapping Tools?

GMT is an open source collection of about 100 command line tools for manipulating geographic and Cartesian data sets and producing illustrations, from x-y plots and contour maps to illuminated surfaces, 3D views and animations. The supplements package adds around 50 more specialised tools, and more than 30 map projections are supported.

What data does GMT need to draw coastlines and borders?

It needs GSHHG coastline, river and political boundary data, distributed separately as gshhg-gmt-2.x.x.tar.gz, and it can optionally use Digital Chart of the World country polygons from dcw-gmt-2.x.x.tar.gz. Elevation and raster sources are listed as well, including the SRTM, GEBCO and IGPP elevation models.

How do I install GMT?

The main distribution is gmt-6.x.x.tar.gz, with separate installers for macOS and Windows, and UNIX, Linux, macOS, FreeBSD and OpenBSD are the platforms it has been installed on successfully. The project publishes install instructions for the package and a separate BUILDING.md for building it from the sources with CMake.

What licence is GMT released under?

The GNU Lesser General Public License version 3 or any later version, with copyright held by the GMT Team from 1991 to 2026. The full terms are in the LICENSE.TXT file in the repository.

Where should I report a bug in GMT?

Open an issue in the project issue tracker with enough information for the problem to be recreated, rather than patching it locally. General questions go to the GMT Community Forum, and contributions are covered by the contributing guidelines.

Official sources

  1. GenericMappingTools/gmt on GitHub
  2. Issues
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/genericmappingtools-gmt.svg)](https://hysenlabs.com/projects/genericmappingtools-gmt)

Was this useful?