• Stars
    star
    744
  • Rank 60,526 (Top 2 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created over 7 years ago
  • Updated 23 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Python interface for the Generic Mapping Tools.

PyGMT

A Python interface for the Generic Mapping Tools

Documentation (development version) | Contact | Try Online

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

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 PyData 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:

mamba install --channel conda-forge pygmt

If you use conda:

conda install --channel conda-forge pygmt

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

Getting started

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

import pygmt
fig = pygmt.Figure()
fig.coast(projection="H10c", region="g", frame=True, land="gray")
fig.show()

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_2023_7772533,
  author       = {Uieda, Leonardo and
                  Tian, Dongdong and
                  Leong, Wei Ji and
                  Schlitzer, William and
                  Grund, Michael and
                  Jones, Max and
                  Fröhlich, Yvonne and
                  Toney, Liam and
                  Yao, Jiayuan and
                  Magen, Yohai and
                  Tong, Jing-Hui 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        = mar,
  year         = 2023,
  publisher    = {Zenodo},
  version      = {0.9.0},
  doi          = {10.5281/zenodo.7772533},
  url          = {https://doi.org/10.5281/zenodo.7772533}
}

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

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

Other Python wrappers for GMT (not maintained):

Compatibility with GMT/Python/NumPy versions

PyGMT Version Documentation GMT Python NumPy
Dev (upcoming release) Dev Documentation (reflects main branch) >=6.3.0 >=3.9 >=1.22
v0.9.0 (latest release) v0.9.0 Documentation >=6.3.0 >=3.8 >=1.21
v0.8.0 v0.8.0 Documentation >=6.3.0 >=3.8 >=1.20
v0.7.0 v0.7.0 Documentation >=6.3.0 >=3.8 >=1.20
v0.6.1 v0.6.1 Documentation >=6.3.0 >=3.8 >=1.19
v0.6.0 v0.6.0 Documentation >=6.3.0 >=3.8 >=1.19
v0.5.0 v0.5.0 Documentation >=6.2.0 >=3.7 >=1.18
v0.4.1 v0.4.1 Documentation >=6.2.0 >=3.7 >=1.17
v0.4.0 v0.4.0 Documentation >=6.2.0 >=3.7 >=1.17
v0.3.1 v0.3.1 Documentation >=6.1.1 >=3.7  
v0.3.0 v0.3.0 Documentation >=6.1.1 >=3.7  
v0.2.1 v0.2.1 Documentation >=6.1.1 >=3.6  
v0.2.0 v0.2.0 Documentation >=6.1.1 3.6 - 3.8  
v0.1.2 v0.1.2 Documentation >=6.0.0 3.6 - 3.8  
v0.1.1 v0.1.1 Documentation >=6.0.0 3.6 - 3.8  
v0.1.0 v0.1.0 Documentation >=6.0.0 3.6 - 3.8  

More Repositories

1

gmt

The Generic Mapping Tools
C
834
star
2

GMT.jl

Generic Mapping Tools Library Wrapper for Julia
Julia
193
star
3

gmtmex

GMT API for MATLAB
MATLAB
41
star
4

try-gmt

Try GMT, PyGMT, and GMT.jl online! All in one place!
Jupyter Notebook
41
star
5

gmt-for-geodesy

Material for the annual GMT for EarthScope short course
Jupyter Notebook
33
star
6

2020-unavco-course

Planning and material for the 2020 UNAVCO GMT for Geodesy course
Shell
33
star
7

egu22pygmt

Crafting beautiful maps with PyGMT at EGU22
Jupyter Notebook
32
star
8

2021-unavco-course

Planning and material for the 2021 UNAVCO GMT for Geodesy course
Shell
28
star
9

2019-unavco-course

Material for the 2019 UNAVCO Short Course "The Generic Mapping Tools for Geodesy"
Shell
21
star
10

gshhg-gmt

Scripts and raw data that combine to produce the GSHHG data sets for GMT
C
20
star
11

RemoteS.jl

Remote sensing data processing
Julia
18
star
12

foss4g2019oceania

PyGMT Workshop at FOSS4G Oceania 2019, Wellington, New Zealand
Jupyter Notebook
14
star
13

website

A front page for the GMT project
HTML
10
star
14

sphinx_gmt

Sphinx extensions for GMT
Python
7
star
15

gmtserver-admin

Cache data and script for managing the GMT data server
Shell
7
star
16

dcw-gmt

Data and scripts that maintain and build the DCW data used in GMT
Shell
7
star
17

remote-datasets

Documentation for remote datasets on the GMT server
Shell
5
star
18

GMTjl_doc

GMT.jl documentation site
HTML
5
star
19

try-gmt-python

A Jupyter notebook demo of the latest GMT/Python. Runs on mybinder.org.
Jupyter Notebook
4
star
20

2021-eswn-pygmt-workshop

A workshop on open source development
Jupyter Notebook
4
star
21

gmt-examples

Tutorials and guides for the Generic Mapping Tools
4
star
22

genericmappingtools.github.io

Built HTML for the GMT website. DO NOT COMMIT DIRECTLY HERE
HTML
3
star
23

scipy2021

PyGMT tutorial submission for SciPy 2021
3
star
24

agu24workshop

Mastering Geospatial Visualizations with GMT/PyGMT pre-conference workshop at AGU24
3
star
25

gmtmodernize

Tool to convert GMT scripts to the new "modern" mode
Python
2
star
26

gsrasterize

Play code to attempt to convert PS directly to Ghotscript formats without saving intermediate files to disk.
C
2
star
27

gmt6demo

A demo of new features in GMT6. Uses Jupyter notebooks and runs online on mybinder.org (no install required).
Jupyter Notebook
2
star
28

gmt-rpm

RPM specfiles for the Fedora Copr build system
2
star
29

.github

Community files
1
star
30

custom-supplements

How to make custom GMT supplements
PostScript
1
star
31

building-wrappers

Documentation and discussion about building wrappers for GMT
1
star
32

oversight

Reports and planning documents for the GMT Steering Committee
1
star
33

gmt-fortran

GMT API for FORTRAN
Fortran
1
star
34

gmt-2024-animation

Illustration and movie scripts for 2024 publication on GMT animations
Shell
1
star