PyGMT: Accessing the Generic Mapping Tools from Python

Leonardo Uieda, Paul Wessel



This is an update on the progress we've made in PyGMT. There are examples of some of the new features implemented by myself and contributors, as well as the main problems we're facing and a call for volunteers.

You can run all of the code in the poster online using Binder: launch binder

The main feedback we got during the meeting is that the API is not very intuitive for people unfamiliar with GMT (which I expect to be the majority of users). This has got me thinking of ways to move away from the direct mapping of GMT modules to PyGMT functions. Instead, we should implement something that makes sense in Python and call whatever GMT modules we need to get that done under the hood.

The poster presented at the meeting.


For almost 30 years, the Generic Mapping Tools (GMT) have provided the Earth, Ocean, and Planetary Sciences with an open-source toolbox for processing and visualizing spatial data (bathymetry, gravity, magnetic, earthquake focal mechanisms, and more). In many fields, GMT is the de facto standard for creating high-resolution publication quality maps, figures, and animations. Since version 5, GMT has provided a C language Application Programming Interface (API) that allows other programs to access its core functionality. We are using this bridge to develop PyGMT (; formerly GMT/Python), an open-source library that allows users of the Python programming language to leverage the almost thirty years of continuous GMT development. PyGMT is designed to integrate with the existing scientific Python ecosystem, including popular packages such as numpy, pandas, and xarray. PyGMT integrates seamlessly with the Jupyter notebook, allowing high-quality figures to be generated interactively both in a personal computer and in cloud computing environments compatible with Jupyter. We will present the design and usage of the software package, latest developments and updates, and lessons learned during its implementation.


Uieda, L. & Wessel, P. (2019). PyGMT: Accessing the Generic Mapping Tools from Python. In Eos Trans. AGU (Abstract NS21B-0813).

Article Level Metrics

Comments? Let me know on Twitter (tweet @leouieda).
Found a typo/mistake? Send a fix through Github. All you need is an account and 5 minutes!

Related pages