A Python interface for the Generic Mapping Tools
PyGMT is a library for processing geospatial and geophysical data and making publication-quality maps and figures. It provides a Pythonic interface for the Generic Mapping Tools (GMT), a command-line program widely used across the Earth, Ocean, and Planetary sciences and beyond.
A beautiful map is worth a thousand words. To experience the power of PyGMT, try it online with Binder or Google Colab without installing anything on your computer. For a quick introduction, check out our 3 minute overview!
PyGMT depends on GMT and the following Python libraries:
- Required: NumPy, pandas, xarray, packaging
- Optional: IPython, GeoPandas, contextily, rioarray, PyArrow
For detailed version requirements, see Minimum Supported Versions.
Install PyGMT using conda:
conda install --channel conda-forge pygmtThen try the following example in a Python interpreter or Jupyter notebook. You should see a global map with land and water masses colored in tan and lightblue, respectively, with the semi-transparent text "PyGMT" on top.
import pygmt
fig = pygmt.Figure()
fig.basemap(projection="R7c", region=[0, 360, -90, 90], frame=True)
fig.coast(land="tan", water="lightblue")
fig.text(position="MC", text="PyGMT", font="40p,AvantGarde-Book,red@75")
fig.show()- Documentation: Latest version | Development version
- Full installation instructions
- Gallery and Tutorials
- PyGMT Ecosystem
- Citing PyGMT
- Most discussion happens on GitHub. Feel free to open an issue or comment on any open issue or pull request.
- We have a Discourse forum where you can ask questions and leave comments.
We want everyone to feel welcome to contribute to this project and participate in discussions. In that spirit please have a look at our Code of Conduct.
Imposter syndrome disclaimer: We want your help. No, really.
There may be a little voice inside your head that is telling you that you're not ready to be an open source contributor; that your skills aren't nearly good enough to contribute. What could you possibly offer?
We assure you that the little voice in your head is wrong.
Being a contributor doesn't just mean writing code. Equally important contributions include: writing or proof-reading documentation, suggesting or implementing tests, or even giving feedback about the project (including giving feedback about the contribution process). If you're coming to the project with fresh eyes, you might see the errors and assumptions that seasoned contributors have glossed over. If you can write any code at all, you can contribute code to open source. We are constantly trying out new skills, making mistakes, and learning from those mistakes. That's how we all improve and we are happy to help others learn.
Please read our Contributing Guide to see how you can help and give feedback.
This disclaimer was adapted from the MetPy project.
Other official GMT wrappers include:
The development of PyGMT has been supported by NSF grants OCE-1558403 and EAR-1948602.
PyGMT is free software: you can redistribute it and/or modify it under the terms of the BSD 3-clause License. A copy of this license is provided in LICENSE.txt.