import gmt

# Load sample earthquake data in a pandas.DataFrame
quakes = gmt.datasets.load_usgs_quakes()

# Load the builtin Earth relief grid as an xarray.DataArray.
relief = gmt.datasets.load_earth_relief(resolution="30m")

# The Figure object controls all plotting functions
fig = gmt.Figure()
# Setup a map with a global region, a Mollweide projection, and automatic ticks
fig.basemap(region="g", projection="W200/8i", frame=True)
# Plot the Earth relief grid in pseudo-color.
fig.grdimage(relief, cmap="geo")
# Plot earthquakes as circles. Size maps to magnitude and color to depth.
fig.plot(x=quakes.longitude, y=quakes.latitude, sizes=0.01*2**quakes.mag,
         color=quakes.depth/quakes.depth.max(), cmap="viridis", style="cc")
# Show a preview of the image (inline if in a Jupyter notebook).
fig.show()

Attention

This package is in early stages development. We welcome any feedback and ideas! Let us know by submitting issues on Github or send us a message on our Gitter chatroom.

Getting Started

  1. Try an online demo at try.gmtpython.xyz
  2. Install (Linux and Mac)
  3. Follow the Tutorials.
  4. Take a look at the API Reference to see what is available.

Note

Found a typo? You can fix it by clicking on “Improve this page” at the top of every page. Some pages are autogenerated and can’t be edited so you’ll be prompted to report an issue instead. We really appreciate the help!

Project Goals

Contacting Us

Contributing

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