# PyGMT
> A Python interface for the Generic Mapping Tools
[Documentation (development version)](https://www.pygmt.org/dev) | [Contact](https://forum.generic-mapping-tools.org) | [TryOnline](https://github.com/GenericMappingTools/try-gmt)
[](https://pypi.org/project/pygmt)
[](https://anaconda.org/conda-forge/pygmt)
[](https://github.com/GenericMappingTools/pygmt/blob/main/LICENSE.txt)
[](https://www.pygmt.org/dev/minversions.html)
[](https://doi.org/10.5281/zenodo.3781524)
[](https://forum.generic-mapping-tools.org)
[](https://github.com/pyOpenSci/software-review/issues/43)
[](https://github.com/GenericMappingTools/.github/blob/main/CODE_OF_CONDUCT.md)
[](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests.yaml)
[](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_dev.yaml)
[](https://app.codecov.io/gh/GenericMappingTools/pygmt)
[](https://github.com/astral-sh/ruff)
[](https://codspeed.io/GenericMappingTools/pygmt)
<!-- doc-index-start-after -->
## Why PyGMT?
A beautiful map is worth a thousand words. To truly understand how powerful PyGMT is,
play with it online on [Binder](https://github.com/GenericMappingTools/try-gmt)! For a
quicker introduction, check out our [3 minute overview](https://youtu.be/4iPnITXrxVU)!
Afterwards, feel free to look at our [Tutorials](https://www.pygmt.org/latest/tutorials),
visit the [Gallery](https://www.pygmt.org/latest/gallery), and check out some
[external PyGMT examples](https://www.pygmt.org/latest/external_resources.html)!

## 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)](https://github.com/GenericMappingTools/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](https://scientific-python.org/):
`numpy.ndarray` or `pandas.DataFrame` for data tables, `xarray.DataArray` for grids,
and `geopandas.GeoDataFrame` for geographical data.
## Quickstart
### Installation
Simple installation using [mamba](https://mamba.readthedocs.org/):
```bash
mamba install --channel conda-forge pygmt
```
If you use [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/index.html):
```bash
conda install --channel conda-forge pygmt
```
For other ways to install `pygmt`, see the [full installation instructions](https://www.pygmt.org/latest/install.html).
### Getting started
As a starting point, you can open a [Python interpreter](https://docs.python.org/3/tutorial/interpreter.html)
or a [Jupyter notebook](https://docs.jupyter.org/en/latest/running.html), 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](https://www.pygmt.org/latest/gallery/index.html) and
[Tutorials](https://www.pygmt.org/latest/tutorials/index.html).
## Contacting us
- Most discussion happens [on GitHub](https://github.com/GenericMappingTools/pygmt).
Feel free to [open an issue](https://github.com/GenericMappingTools/pygmt/issues/new)
or comment on any open issue or pull request.
- We have a [Discourse forum](https://forum.generic-mapping-tools.org/c/questions/pygmt-q-a)
where you can ask questions and leave comments.
## Contributing
### Code of conduct
Please note that this project is released with a
[Contributor Code of Conduct](https://github.com/GenericMappingTools/.github/blob/main/CODE_OF_CONDUCT.md).
By participating in this project you agree to abide by its terms.
### Contributing guidelines
Please read our [Contributing Guide](https://github.com/GenericMappingTools/pygmt/blob/main/CONTRIBUTING.md)
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](https://github.com/Unidata/MetPy).
## Citing PyGMT
PyGMT is a community developed project. See the
[AUTHORS.md](https://github.com/GenericMappingTools/pygmt/blob/main/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_14868324,
author = {Tian, Dongdong and
Uieda, Leonardo and
Leong, Wei Ji and
Fröhlich, Yvonne and
Schlitzer, William and
Grund, Michael 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 = feb,
year = 2025,
publisher = {Zenodo},
version = {0.14.2},
doi = {10.5281/zenodo.14868324},
url = {https://doi.org/10.5281/zenodo.14868324}
}
```
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](https://doi.org/10.1029/2019GC008515) (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](https://github.com/GenericMappingTools/pygmt/blob/main/LICENSE.txt).
## Support
The development of PyGMT has been supported by NSF grants
[OCE-1558403](https://www.nsf.gov/awardsearch/showAward?AWD_ID=1558403) and
[EAR-1948603](https://www.nsf.gov/awardsearch/showAward?AWD_ID=1948602).
## Related projects
Other official wrappers for GMT:
- [GMT.jl](https://github.com/GenericMappingTools/GMT.jl): A Julia wrapper for GMT.
- [gmtmex](https://github.com/GenericMappingTools/gmtmex): A Matlab/Octave wrapper for GMT.
<!-- doc-index-end-before -->
## Minimum supported versions
PyGMT has adopted [SPEC 0](https://scientific-python.org/specs/spec-0000/) 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](https://www.pygmt.org/dev/minversions.html)
for the detailed policy and the minimum supported versions of GMT, Python and core
package dependencies.
Raw data
{
"_id": null,
"home_page": null,
"name": "pygmt",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "cartography, geodesy, geology, geophysics, geospatial, oceanography, seismology",
"author": null,
"author_email": "The PyGMT Developers <pygmt.team@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/bf/94/083a13d03525b19c80a8134438823008143f0990f3f52055e83ff9e2a9ad/pygmt-0.14.2.tar.gz",
"platform": "Any",
"description": "# PyGMT\n\n> A Python interface for the Generic Mapping Tools\n\n[Documentation (development version)](https://www.pygmt.org/dev) | [Contact](https://forum.generic-mapping-tools.org) | [TryOnline](https://github.com/GenericMappingTools/try-gmt)\n\n[](https://pypi.org/project/pygmt)\n[](https://anaconda.org/conda-forge/pygmt)\n[](https://github.com/GenericMappingTools/pygmt/blob/main/LICENSE.txt)\n[](https://www.pygmt.org/dev/minversions.html)\n[](https://doi.org/10.5281/zenodo.3781524)\n[](https://forum.generic-mapping-tools.org)\n[](https://github.com/pyOpenSci/software-review/issues/43)\n[](https://github.com/GenericMappingTools/.github/blob/main/CODE_OF_CONDUCT.md)\n[](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests.yaml)\n[](https://github.com/GenericMappingTools/pygmt/actions/workflows/ci_tests_dev.yaml)\n[](https://app.codecov.io/gh/GenericMappingTools/pygmt)\n[](https://github.com/astral-sh/ruff)\n[](https://codspeed.io/GenericMappingTools/pygmt)\n\n<!-- doc-index-start-after -->\n\n## Why PyGMT?\n\nA beautiful map is worth a thousand words. To truly understand how powerful PyGMT is,\nplay with it online on [Binder](https://github.com/GenericMappingTools/try-gmt)! For a\nquicker introduction, check out our [3 minute overview](https://youtu.be/4iPnITXrxVU)!\n\nAfterwards, feel free to look at our [Tutorials](https://www.pygmt.org/latest/tutorials),\nvisit the [Gallery](https://www.pygmt.org/latest/gallery), and check out some\n[external PyGMT examples](https://www.pygmt.org/latest/external_resources.html)!\n\n\n\n## About\n\nPyGMT is a library for processing geospatial and geophysical data and making\npublication-quality maps and figures. It provides a Pythonic interface for the\n[Generic Mapping Tools (GMT)](https://github.com/GenericMappingTools/gmt), a command-line\nprogram widely used across the Earth, Ocean, and Planetary sciences and beyond.\n\n## Project goals\n\n- Make GMT more accessible to new users.\n- Build a Pythonic API for GMT.\n- Interface with the GMT C API directly using ctypes (no system calls).\n- Support for rich display in the Jupyter notebook.\n- Integration with the [scientific Python ecosystem](https://scientific-python.org/):\n `numpy.ndarray` or `pandas.DataFrame` for data tables, `xarray.DataArray` for grids,\n and `geopandas.GeoDataFrame` for geographical data.\n\n## Quickstart\n\n### Installation\n\nSimple installation using [mamba](https://mamba.readthedocs.org/):\n\n```bash\nmamba install --channel conda-forge pygmt\n```\n\nIf you use [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/index.html):\n\n```bash\nconda install --channel conda-forge pygmt\n```\n\nFor other ways to install `pygmt`, see the [full installation instructions](https://www.pygmt.org/latest/install.html).\n\n### Getting started\n\nAs a starting point, you can open a [Python interpreter](https://docs.python.org/3/tutorial/interpreter.html)\nor a [Jupyter notebook](https://docs.jupyter.org/en/latest/running.html), and try the\nfollowing example:\n\n``` python\nimport pygmt\nfig = pygmt.Figure()\nfig.coast(projection=\"N15c\", region=\"g\", frame=True, land=\"tan\", water=\"lightblue\")\nfig.text(position=\"MC\", text=\"PyGMT\", font=\"80p,Helvetica-Bold,red@75\")\nfig.show()\n```\n\nYou should see a global map with land and water masses colored in tan and lightblue,\nrespectively. On top, there should be the semi-transparent text \"PyGMT\". For more examples,\nplease have a look at the [Gallery](https://www.pygmt.org/latest/gallery/index.html) and\n[Tutorials](https://www.pygmt.org/latest/tutorials/index.html).\n\n## Contacting us\n\n- Most discussion happens [on GitHub](https://github.com/GenericMappingTools/pygmt).\n Feel free to [open an issue](https://github.com/GenericMappingTools/pygmt/issues/new)\n or comment on any open issue or pull request.\n- We have a [Discourse forum](https://forum.generic-mapping-tools.org/c/questions/pygmt-q-a)\n where you can ask questions and leave comments.\n\n## Contributing\n\n### Code of conduct\n\nPlease note that this project is released with a\n[Contributor Code of Conduct](https://github.com/GenericMappingTools/.github/blob/main/CODE_OF_CONDUCT.md).\nBy participating in this project you agree to abide by its terms.\n\n### Contributing guidelines\n\nPlease read our [Contributing Guide](https://github.com/GenericMappingTools/pygmt/blob/main/CONTRIBUTING.md)\nto see how you can help and give feedback.\n\n### Imposter syndrome disclaimer\n\n**We want your help.** No, really.\n\nThere may be a little voice inside your head that is telling you that you're not ready\nto be an open source contributor; that your skills aren't nearly good enough to\ncontribute. What could you possibly offer?\n\nWe assure you that the little voice in your head is wrong.\n\n**Being a contributor doesn't just mean writing code.** Equally important contributions\ninclude: writing or proof-reading documentation, suggesting or implementing tests, or\neven giving feedback about the project (including giving feedback about the contribution\nprocess). If you're coming to the project with fresh eyes, you might see the errors and\nassumptions that seasoned contributors have glossed over. If you can write any code at\nall, you can contribute code to open source. We are constantly trying out new skills,\nmaking mistakes, and learning from those mistakes. That's how we all improve and we are\nhappy to help others learn.\n\n*This disclaimer was adapted from the* [MetPy project](https://github.com/Unidata/MetPy).\n\n## Citing PyGMT\n\nPyGMT is a community developed project. See the\n[AUTHORS.md](https://github.com/GenericMappingTools/pygmt/blob/main/AUTHORS.md) file\non GitHub for a list of the people involved and a definition of the term \"PyGMT Developers\".\nFeel free to cite our work in your research using the following BibTeX:\n\n```\n@software{\n pygmt_2025_14868324,\n author = {Tian, Dongdong and\n Uieda, Leonardo and\n Leong, Wei Ji and\n Fr\u00f6hlich, Yvonne and\n Schlitzer, William and\n Grund, Michael and\n Jones, Max and\n Toney, Liam and\n Yao, Jiayuan and\n Tong, Jing-Hui and\n Magen, Yohai and\n Materna, Kathryn and\n Belem, Andre and\n Newton, Tyler and\n Anant, Abhishek and\n Ziebarth, Malte and\n Quinn, Jamie and\n Wessel, Paul},\n title = {{PyGMT: A Python interface for the Generic Mapping Tools}},\n month = feb,\n year = 2025,\n publisher = {Zenodo},\n version = {0.14.2},\n doi = {10.5281/zenodo.14868324},\n url = {https://doi.org/10.5281/zenodo.14868324}\n}\n```\n\nTo cite a specific version of PyGMT, go to our Zenodo page at <https://doi.org/10.5281/zenodo.3781524>\nand use the \"Export to BibTeX\" function there. It is also strongly recommended to cite\nthe [GMT 6 paper](https://doi.org/10.1029/2019GC008515) (which PyGMT wraps around). Note\nthat some modules like `dimfilter`, `surface`, and `x2sys` also have their dedicated\ncitations. Further information for all these can be found at <https://www.generic-mapping-tools.org/cite>.\n\n## License\n\nPyGMT is free software: you can redistribute it and/or modify it under the terms of the\n**BSD 3-clause License**. A copy of this license is provided in\n[LICENSE.txt](https://github.com/GenericMappingTools/pygmt/blob/main/LICENSE.txt).\n\n## Support\n\nThe development of PyGMT has been supported by NSF grants\n[OCE-1558403](https://www.nsf.gov/awardsearch/showAward?AWD_ID=1558403) and\n[EAR-1948603](https://www.nsf.gov/awardsearch/showAward?AWD_ID=1948602).\n\n## Related projects\n\nOther official wrappers for GMT:\n\n- [GMT.jl](https://github.com/GenericMappingTools/GMT.jl): A Julia wrapper for GMT.\n- [gmtmex](https://github.com/GenericMappingTools/gmtmex): A Matlab/Octave wrapper for GMT.\n\n<!-- doc-index-end-before -->\n\n## Minimum supported versions\n\nPyGMT has adopted [SPEC 0](https://scientific-python.org/specs/spec-0000/) alongside the\nrest of the scientific Python ecosystem, and made a few extensions based on the needs of\nthe project. Please see [Minimum Supported Versions](https://www.pygmt.org/dev/minversions.html)\nfor the detailed policy and the minimum supported versions of GMT, Python and core\npackage dependencies.\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python interface for the Generic Mapping Tools",
"version": "0.14.2",
"project_urls": {
"changelog": "https://www.pygmt.org/latest/changes.html",
"documentation": "https://www.pygmt.org",
"homepage": "https://www.pygmt.org",
"repository": "https://github.com/GenericMappingTools/pygmt"
},
"split_keywords": [
"cartography",
" geodesy",
" geology",
" geophysics",
" geospatial",
" oceanography",
" seismology"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "43d1293c48ee954ff62da280aef51a84557a936b283e83c191bf97c19ef50594",
"md5": "4e7c38a92ff0c493451308fe93e602e1",
"sha256": "c5fcf7dd40b73cb8a5736199a940beddaa4d40ede31d187dfd2fc02b4dee9187"
},
"downloads": -1,
"filename": "pygmt-0.14.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4e7c38a92ff0c493451308fe93e602e1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 290139,
"upload_time": "2025-02-15T02:57:38",
"upload_time_iso_8601": "2025-02-15T02:57:38.160551Z",
"url": "https://files.pythonhosted.org/packages/43/d1/293c48ee954ff62da280aef51a84557a936b283e83c191bf97c19ef50594/pygmt-0.14.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bf94083a13d03525b19c80a8134438823008143f0990f3f52055e83ff9e2a9ad",
"md5": "687ca31501975d26aa7b1a87641ab57d",
"sha256": "c9cf4b54532e767d41a260fd23da5dba11dba382d015d2c7d3a20c73efceb590"
},
"downloads": -1,
"filename": "pygmt-0.14.2.tar.gz",
"has_sig": false,
"md5_digest": "687ca31501975d26aa7b1a87641ab57d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 209027,
"upload_time": "2025-02-15T02:57:40",
"upload_time_iso_8601": "2025-02-15T02:57:40.340883Z",
"url": "https://files.pythonhosted.org/packages/bf/94/083a13d03525b19c80a8134438823008143f0990f3f52055e83ff9e2a9ad/pygmt-0.14.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-15 02:57:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "GenericMappingTools",
"github_project": "pygmt",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "numpy",
"specs": [
[
">=",
"1.25"
]
]
},
{
"name": "pandas",
"specs": [
[
">=",
"2.0"
]
]
},
{
"name": "xarray",
"specs": [
[
">=",
"2023.04"
]
]
},
{
"name": "netCDF4",
"specs": []
},
{
"name": "packaging",
"specs": []
}
],
"lcname": "pygmt"
}