pygmt

A Python interface for the Generic Mapping Tools.

https://github.com/genericmappingtools/pygmt

Science Score: 77.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 10 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    2 of 51 committers (3.9%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.7%) to scientific vocabulary

Keywords

earth-science geophysics geoscience hacktoberfest maps python seismology

Keywords from Contributors

generic-mapping-tools mesh interpolation open-science closember pygmt batteries hydrology regionalization finite-elements
Last synced: 6 months ago · JSON representation ·

Repository

A Python interface for the Generic Mapping Tools.

Basic Info
  • Host: GitHub
  • Owner: GenericMappingTools
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: main
  • Homepage: https://www.pygmt.org
  • Size: 285 MB
Statistics
  • Stars: 814
  • Watchers: 27
  • Forks: 230
  • Open Issues: 200
  • Releases: 24
Topics
earth-science geophysics geoscience hacktoberfest maps python seismology
Created almost 9 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing License Citation Authors

README.md

PyGMT

A Python interface for the Generic Mapping Tools

Documentation (development version) | Contact | TryOnline

Latest version on PyPI Latest version on conda-forge GitHub license Compatible Python versions Digital Object Identifier for the Zenodo archive Discourse forum PyOpenSci Contributor Code of Conduct GitHub Actions Tests status GitHub Actions GMT Dev Tests status Test coverage status Ruff CodSpeed Performance Benchmarks

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!

Quick Introduction to PyGMT YouTube Video

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.ndarray or pandas.DataFrame for data tables, xarray.DataArray for grids, and geopandas.GeoDataFrame for geographical data.

Quickstart

Installation

Simple installation using mamba:

bash mamba install --channel conda-forge pygmt

If you use conda:

bash conda install --channel conda-forge pygmt

For other ways to install pygmt, see the full installation instructions.

Getting started

As a starting point, you can open a Python interpreter or a Jupyter notebook, and try the following example:

python import pygmt fig = pygmt.Figure() fig.coast(projection="N15c", region="g", frame=True, land="tan", water="lightblue") fig.text(position="MC", text="PyGMT", font="80p,Helvetica-Bold,red@75") fig.show()

You should see a global map with land and water masses colored in tan and lightblue, respectively. On top, there should be the semi-transparent text "PyGMT". For more examples, please have a look at the Gallery and Tutorials.

Contacting us

Contributing

Code of conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Contributing guidelines

Please read our Contributing Guide to see how you can help and give feedback.

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.

This disclaimer was adapted from the MetPy project.

Citing PyGMT

PyGMT is a community developed project. See the AUTHORS.md file on GitHub for a list of the people involved and a definition of the term "PyGMT Developers". Feel free to cite our work in your research using the following BibTeX:

@software{ pygmt_2025_15628725, author = {Tian, Dongdong and Uieda, Leonardo and Leong, Wei Ji and Fröhlich, Yvonne and Grund, Michael and Schlitzer, William and Jones, Max and Toney, Liam and Yao, Jiayuan and Tong, Jing-Hui and Magen, Yohai and Materna, Kathryn and Belem, Andre and Newton, Tyler and Anant, Abhishek and Ziebarth, Malte and Quinn, Jamie and Wessel, Paul}, title = {{PyGMT: A Python interface for the Generic Mapping Tools}}, month = jun, year = 2025, publisher = {Zenodo}, version = {0.16.0}, doi = {10.5281/zenodo.15628725}, url = {https://doi.org/10.5281/zenodo.15628725} }

To cite a specific version of PyGMT, go to our Zenodo page at https://doi.org/10.5281/zenodo.3781524 and use the "Export to BibTeX" function there. It is also strongly recommended to cite the GMT 6 paper (which PyGMT wraps around). Note that some modules like dimfilter, surface, and x2sys also have their dedicated citations. Further information for all these can be found at https://www.generic-mapping-tools.org/cite.

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-1948603.

Related projects

Other official wrappers for GMT:

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

Minimum supported versions

PyGMT has adopted SPEC 0 alongside the rest of the scientific Python ecosystem, and made a few extensions based on the needs of the project. Please see Minimum Supported Versions for the detailed policy and the minimum supported versions of GMT, Python and core package dependencies.

Owner

  • Name: The Generic Mapping Tools (GMT)
  • Login: GenericMappingTools
  • Kind: organization

Tools for manipulating geographic and Cartesian data and creating plots, maps, and 3D views

Citation (CITATION.cff)

# YAML 1.2
# Metadata for citation of this software according to the CFF format (https://citation-file-format.github.io/)
cff-version: 1.2.0
message: If you use this software, please cite it as follows.
title: 'PyGMT: A Python interface for the Generic Mapping Tools'
authors:
- given-names: Dongdong
  family-names: Tian
  affiliation: China University of Geosciences, China
  orcid: https://orcid.org/0000-0001-7967-1197
- given-names: Leonardo
  family-names: Uieda
  affiliation: University of Liverpool, United Kingdom
  orcid: https://orcid.org/0000-0001-6123-9515
- given-names: Wei Ji
  family-names: Leong
  affiliation: Development Seed, USA
  orcid: https://orcid.org/0000-0003-2354-1988
- given-names: Yvonne
  family-names: Fröhlich
  affiliation: Unaffiliated
  orcid: https://orcid.org/0000-0002-8566-0619
- given-names: Michael
  family-names: Grund
  affiliation: SNP Innovation Lab GmbH, Germany
  orcid: https://orcid.org/0000-0001-8759-2018
- given-names: William
  family-names: Schlitzer
  affiliation: Unaffiliated
  orcid: https://orcid.org/0000-0002-5843-2282
- given-names: Max
  family-names: Jones
  affiliation: University of Hawaiʻi at Mānoa, USA
  orcid: https://orcid.org/0000-0003-0180-8928
- given-names: Liam
  family-names: Toney
  affiliation: University of Alaska Fairbanks, USA
  orcid: https://orcid.org/0000-0003-0167-9433
- given-names: Jiayuan
  family-names: Yao
  affiliation: Nanyang Technological University, Singapore
  orcid: https://orcid.org/0000-0001-7036-4238
- given-names: Jing-Hui
  family-names: Tong
  affiliation: National Taiwan Normal University, Taiwan
  orcid: https://orcid.org/0009-0002-7195-3071
- given-names: Yohai
  family-names: Magen
  affiliation: Tel Aviv University, Israel
  orcid: https://orcid.org/0000-0002-4892-4013
- given-names: Kathryn
  family-names: Materna
  affiliation: US Geological Survey, USA
  orcid: https://orcid.org/0000-0002-6687-980X
- given-names: Andre
  family-names: Belem
  affiliation: Fluminense Federal University, Brazil
  orcid: https://orcid.org/0000-0002-8865-6180
- given-names: Tyler
  family-names: Newton
  affiliation: University of Oregon, USA
  orcid: https://orcid.org/0000-0002-1560-6553
- given-names: Abhishek
  family-names: Anant
  affiliation: Unaffiliated
  orcid: https://orcid.org/0000-0002-5751-2010
- given-names: Malte
  family-names: Ziebarth
  affiliation: GFZ German Research Centre for Geosciences, Germany
  orcid: https://orcid.org/0000-0002-5190-4478
- given-names: Jamie
  family-names: Quinn
  affiliation: University College London, United Kingdom
  orcid: https://orcid.org/0000-0002-0268-7032
- given-names: Paul
  family-names: Wessel
  affiliation: University of Hawaiʻi at Mānoa, USA
  orcid: https://orcid.org/0000-0001-5708-7336
date-released: 2025-06-18
doi: 10.5281/zenodo.15628725
license: BSD-3-Clause
repository-code: https://github.com/GenericMappingTools/pygmt
type: software
version: 0.16.0

GitHub Events

Total
  • Create event: 438
  • Release event: 3
  • Issues event: 153
  • Watch event: 61
  • Delete event: 423
  • Issue comment event: 634
  • Push event: 2,903
  • Pull request review comment event: 1,133
  • Pull request event: 820
  • Pull request review event: 1,211
  • Fork event: 11
Last Year
  • Create event: 438
  • Release event: 3
  • Issues event: 153
  • Watch event: 61
  • Delete event: 423
  • Issue comment event: 634
  • Push event: 2,903
  • Pull request review comment event: 1,133
  • Pull request event: 820
  • Pull request review event: 1,211
  • Fork event: 11

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 2,907
  • Total Committers: 51
  • Avg Commits per committer: 57.0
  • Development Distribution Score (DDS): 0.59
Past Year
  • Commits: 513
  • Committers: 9
  • Avg Commits per committer: 57.0
  • Development Distribution Score (DDS): 0.365
Top Committers
Name Email Commits
Dongdong Tian s****o@g****m 1,193
dependabot[bot] 4****] 309
Yvonne Fröhlich 9****h 302
Wei Ji Leong 2****4 274
Leonardo Uieda l****a@g****m 256
Will Schlitzer s****0@g****m 192
Michael Grund m****d@g****e 150
Max Jones 1****s 110
Jiayuan Yao c****m@g****m 34
Liam Toney 3****y 15
yohaimagen m****y@g****m 7
Jing-Hui Tong 8****g 5
Andre L. Belem a****m@i****r 3
kmaterna k****a@g****m 3
pre-commit-ci[bot] 6****] 3
Tyler Newton 5****n 2
Shivani chauhan 5****i 2
alperen-kilic 5****c 2
carocamargo 4****o 2
Noor Buchi 5****i 2
MichaeINeumann 8****n 2
Jamie J Quinn J****n 2
Conor Bacon c****n@g****m 2
daroari 6****i 2
obaney 8****y 2
srijac 5****c 2
Claudio Satriano s****o@g****m 2
Andrey Shmakov a****v@g****m 2
Amanda Leaman 7****n 2
Abhishek Anant 8****t 2
and 21 more...
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 356
  • Total pull requests: 2,125
  • Average time to close issues: 7 months
  • Average time to close pull requests: 20 days
  • Total issue authors: 79
  • Total pull request authors: 18
  • Average comments per issue: 3.69
  • Average comments per pull request: 0.91
  • Merged pull requests: 1,804
  • Bot issues: 38
  • Bot pull requests: 288
Past Year
  • Issues: 100
  • Pull requests: 960
  • Average time to close issues: 13 days
  • Average time to close pull requests: 5 days
  • Issue authors: 22
  • Pull request authors: 10
  • Average comments per issue: 1.39
  • Average comments per pull request: 0.6
  • Merged pull requests: 809
  • Bot issues: 15
  • Bot pull requests: 147
Top Authors
Issue Authors
  • seisman (149)
  • github-actions[bot] (37)
  • weiji14 (33)
  • yvonnefroehlich (29)
  • maxrjones (15)
  • MarkWieczorek (7)
  • michaelgrund (5)
  • willschlitzer (4)
  • Esteban82 (3)
  • hemmelig (2)
  • kjz1997 (2)
  • JingHuiTong (2)
  • De-Guo (2)
  • jbusecke (1)
  • cuitianyu20 (1)
Pull Request Authors
  • seisman (1,276)
  • yvonnefroehlich (338)
  • dependabot[bot] (282)
  • weiji14 (130)
  • michaelgrund (64)
  • maxrjones (7)
  • pre-commit-ci[bot] (6)
  • willschlitzer (5)
  • JingHuiTong (4)
  • Esteban82 (2)
  • core-man (2)
  • jhtong33 (2)
  • bwwjohnson (2)
  • lattaai4 (1)
  • ZMAlt (1)
Top Labels
Issue Labels
maintenance (78) bug (58) documentation (56) feature request (52) discussions (34) help wanted (30) question (22) upstream (19) longterm (17) enhancement (12) wontfix (9) good first issue (7) skip-changelog (4) deprecation (3) final review call (3) outreach (2) typing (2) triage (1) run/test-gmt-dev (1)
Pull Request Labels
maintenance (1,237) skip-changelog (1,203) documentation (404) final review call (221) enhancement (155) needs review (111) deprecation (94) feature (64) bug (59) typing (52) run/benchmark (27) run/test-gmt-dev (16) upstream (6) longterm (3) question (3) discussions (3)

Packages

  • Total packages: 5
  • Total downloads:
    • pypi 7,602 last-month
  • Total docker downloads: 1,236
  • Total dependent packages: 10
    (may contain duplicates)
  • Total dependent repositories: 67
    (may contain duplicates)
  • Total versions: 87
  • Total maintainers: 4
pypi.org: pygmt

A Python interface for the Generic Mapping Tools

  • Versions: 25
  • Dependent Packages: 9
  • Dependent Repositories: 25
  • Downloads: 7,602 Last month
  • Docker Downloads: 1,236
Rankings
Dependent packages count: 1.9%
Average: 2.9%
Docker downloads count: 2.9%
Dependent repos count: 2.9%
Downloads: 3.9%
Maintainers (3)
Last synced: 6 months ago
proxy.golang.org: github.com/GenericMappingTools/pygmt
  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Forks count: 2.0%
Stargazers count: 2.5%
Average: 3.9%
Dependent packages count: 5.4%
Dependent repos count: 5.7%
Last synced: 6 months ago
proxy.golang.org: github.com/genericmappingtools/pygmt
  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.7%
Last synced: 6 months ago
conda-forge.org: pygmt
  • Versions: 13
  • Dependent Packages: 1
  • Dependent Repositories: 42
Rankings
Dependent repos count: 5.5%
Forks count: 12.9%
Average: 15.9%
Stargazers count: 16.3%
Dependent packages count: 29.0%
Last synced: 6 months ago
spack.io: py-pygmt

A Python interface for the Generic Mapping Tools.

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 27.5%
Dependent packages count: 55.0%
Maintainers (1)
Last synced: over 1 year ago

Dependencies

.github/workflows/cache_data.yaml actions
  • actions/checkout v4.0.0 composite
  • actions/upload-artifact v3 composite
  • mamba-org/setup-micromamba v1.4.4 composite
.github/workflows/check-links.yml actions
  • actions/checkout v4.0.0 composite
  • lycheeverse/lychee-action v1.8.0 composite
  • peter-evans/create-issue-from-file v4 composite
.github/workflows/ci_docs.yml actions
  • actions/checkout v4.0.0 composite
  • dawidd6/action-download-artifact v2.28.0 composite
  • mamba-org/setup-micromamba v1.4.4 composite
.github/workflows/ci_doctests.yaml actions
  • actions/checkout v4.0.0 composite
  • dawidd6/action-download-artifact v2.28.0 composite
  • mamba-org/setup-micromamba v1.4.4 composite
.github/workflows/ci_tests.yaml actions
  • actions/checkout v4.0.0 composite
  • actions/upload-artifact v3 composite
  • codecov/codecov-action v3.1.4 composite
  • dawidd6/action-download-artifact v2.28.0 composite
  • mamba-org/setup-micromamba v1.4.4 composite
.github/workflows/ci_tests_dev.yaml actions
  • actions/checkout v4.0.0 composite
  • actions/upload-artifact v3 composite
  • dawidd6/action-download-artifact v2.28.0 composite
  • mamba-org/setup-micromamba v1.4.4 composite
  • peter-evans/create-or-update-comment v3.0.2 composite
  • tibdex/github-app-token v2 composite
.github/workflows/ci_tests_legacy.yaml actions
  • actions/checkout v4.0.0 composite
  • dawidd6/action-download-artifact v2.28.0 composite
  • mamba-org/setup-micromamba v1.4.4 composite
.github/workflows/dvc-diff.yml actions
  • actions/checkout v4.0.0 composite
  • actions/setup-node v3.8.1 composite
  • iterative/setup-cml v1.2.3 composite
  • iterative/setup-dvc v1.1.2 composite
.github/workflows/format-command.yml actions
  • actions/checkout v4.0.0 composite
  • actions/setup-python v4.7.0 composite
  • peter-evans/create-or-update-comment v3.0.2 composite
  • tibdex/github-app-token v2 composite
.github/workflows/publish-to-pypi.yml actions
  • actions/checkout v4.0.0 composite
  • actions/setup-python v4.7.0 composite
  • pypa/gh-action-pypi-publish v1.8.10 composite
.github/workflows/release-baseline-images.yml actions
  • actions/checkout v4.0.0 composite
  • iterative/setup-dvc v1.1.2 composite
  • shogo82148/actions-upload-release-asset v1.6.6 composite
.github/workflows/release-drafter.yml actions
  • release-drafter/release-drafter v5.24.0 composite
.github/workflows/slash-command-dispatch.yml actions
  • peter-evans/slash-command-dispatch v3 composite
  • tibdex/github-app-token v2 composite
.github/workflows/style_checks.yaml actions
  • actions/checkout v4.0.0 composite
  • actions/setup-python v4.7.0 composite
pyproject.toml pypi
  • netCDF4 *
  • numpy >=1.22
  • packaging *
  • pandas *
  • xarray *
requirements.txt pypi
  • netCDF4 *
  • numpy >=1.22
  • packaging *
  • pandas *
  • xarray *
environment.yml conda
  • black
  • blackdoc
  • build
  • codespell
  • contextily
  • docformatter >=1.7.2
  • dvc
  • geopandas
  • gmt 6.4.0.*
  • ipython
  • jupyter
  • make
  • matplotlib
  • myst-parser
  • netcdf4
  • numpy >=1.22
  • packaging
  • pandas
  • panel
  • pip
  • pylint
  • pytest >=6.0
  • pytest-cov
  • pytest-doctestplus
  • pytest-mpl
  • rioxarray
  • ruff
  • sphinx
  • sphinx-copybutton
  • sphinx-design
  • sphinx-gallery
  • sphinx_rtd_theme
  • xarray