Skip to content

Repository files navigation

PyGMT - A Python interface for the Generic Mapping Tools

A Python interface for the Generic Mapping Tools

GitHub Release Latest version on PyPI Latest version on conda-forge PyPI Python Version
PyGMT paper Digital Object Identifier for the Zenodo archive GitHub license
GitHub Actions Tests status GitHub Actions GMT Dev Tests status Test coverage status

Why PyGMT?

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!

Dependencies

PyGMT depends on GMT and the following Python libraries:

For detailed version requirements, see Minimum Supported Versions.

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()

Documentation

Contacting us

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.

Related projects

Other official GMT wrappers include:

  • GMT.jl: A Julia wrapper for GMT.
  • gmtmex: A Matlab/Octave wrapper for GMT.

Funding

The development of PyGMT has been supported by NSF grants OCE-1558403 and EAR-1948602.

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.

About

A Python interface for the Generic Mapping Tools.

Topics

Resources

Code of conduct

Contributing

Stars

870 stars

Watchers

25 watching

Forks

Releases

Used by

Contributors

Languages