Why PyGMT?
A beautiful map is worth a thousand words. To truly understand how powerful PyGMT is, play with it online on Binder! For a quicker introduction, check out our 3 minute overview!
Afterwards, feel free to look at our Tutorials, visit the Gallery, and check out some external PyGMT examples!
About
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.
Project goals
Make GMT more accessible to new users.
Build a Pythonic API for GMT.
Interface with the GMT C API directly using ctypes (no system calls).
Support for rich display in the Jupyter notebook.
Integration with the scientific Python ecosystem:
numpy.ndarrayorpandas.DataFramefor data tables,xarray.DataArrayfor grids, andgeopandas.GeoDataFramefor geographical data.
Quickstart
Install PyGMT using conda:
conda install --channel conda-forge pygmt
Then 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()
For other ways to install PyGMT and more examples, please visit the PyGMT documentation.
Documentation
Contacting us
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.
Code of conduct
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.
Contributing
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.
License
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.
Support
The development of PyGMT has been supported by NSF grants OCE-1558403 and EAR-1948602.