PyGMT

dev

Getting Started

  • Overview
  • Installing
  • Intro to PyGMT

User Guide

  • Tutorials
  • Gallery
    • Maps and map elements
    • Lines and vectors
    • Symbols and markers
    • Images, contours, and fields
    • 3D Plots
    • Seismology and geodesy
    • Base maps
    • Histograms
    • Plot embellishments
      • Colorbar
      • Day-night terminator and twilights
      • GMT logo
      • Inset
      • Inset map showing a rectangular region
      • Legend
      • Multiple colormaps
      • PyGMT logo
      • Scale bar
      • Text formatting
      • Timestamp
  • Projections
  • External Resources

Reference Documentation

  • API Reference
  • Technical Reference
  • Changelog
  • Minimum Supported Versions
  • Ecosystem

Development

  • PyGMT Team
  • Contributors Guide
  • Maintainers Guide

Getting help and contributing

  • Code of Conduct
  • License
  • Contact
  • Source Code
PyGMT
  • Gallery
  • PyGMT logo
  • Improve this page

Note

Go to the end to download the full example code.

PyGMT logo

Beside the GMT logo, there is a separate PyGMT logo which can be plotted and added to a figure using pygmt.Figure.pygmtlogo. The design of the logo itself is kindly provided by @sfrooti and consists of a visual and the wordmark “PyGMT”. The logo is available in circle and hexagon shape. It can be plotted using colors of Python (blue and yellow) and GMT (red) or in black and white as well as in light or dark mode. The wordmark can be added at the right side or bottom of the visual.

import pygmt

fig = pygmt.Figure()
fig.pygmtlogo()
fig.show()
pygmt logo
fig = pygmt.Figure()
fig.pygmtlogo(theme="dark", box="+ggray20")
fig.show()
pygmt logo
fig = pygmt.Figure()
fig.basemap(region=[-5, 5, -5, 5], projection="X10c", frame=[1, "+gtan"])

fig.pygmtlogo(position="jTL+o0.2c+w4c", box="+gwhite+p1p,gray")
fig.pygmtlogo(shape="hexagon", position="jTR+o0.2c+w4c")

fig.pygmtlogo(color=False, wordmark=False, position="jTL+o0.5c/2c+w1.5c", box=False)
fig.pygmtlogo(
    color=False,
    theme="dark",
    shape="hexagon",
    wordmark=False,
    position="jTR+o0.5c/2c+w1.5c",
    box=False,
)
fig.pygmtlogo(wordmark="vertical", position="jMC+w2c", box="+gwhite")

fig.show()
pygmt logo

All combinations

i_plot = 0

fig = pygmt.Figure()

for color in [True, False]:
    for theme in ["light", "dark"]:
        for shape in ["circle", "hexagon"]:
            for wordmark in [False, True, "horizontal", "vertical"]:
                for box in [False, True]:
                    if not box:
                        box_used = False
                    elif box:
                        if theme == "light":
                            box_used = "+gwhite"
                        elif theme == "dark":
                            box_used = "+ggray20"
                    # fig = pygmt.Figure()
                    fig.basemap(
                        region=[-1, 1, -1, 1], projection="X2.5c/3.5c", frame="+gtan"
                    )
                    # fig.image("@needle.png", position="jMC+w2c", box=box_used)
                    fig.pygmtlogo(
                        color=color,
                        theme=theme,
                        shape=shape,
                        wordmark=wordmark,
                        position="jMC+w2c",
                        box=box_used,
                    )

                    fig.shift_origin(xshift="+w+0.5c")
                    n_hor = 8
                    if i_plot in range(n_hor - 1, 100, n_hor):
                        fig.shift_origin(
                            xshift=f"-{(n_hor * 2.5 + n_hor * 0.5)}c",
                            yshift="-h-0.5c",
                        )  # n_hor*width + n_hor*xshift

                    i_plot = i_plot + 1
fig.show()
pygmt logo

All versions modified from https://github.com/GenericMappingTools/pygmt/pull/3849#issuecomment-2753372170 by @seisman

fig = pygmt.Figure()

# Logo without workmark.
fig.basemap(region=[0, 7, 0, 13], projection="x1c", frame="a1f1g1")
for x, y, theme in [(1, 3, "light"), (4, 3, "dark")]:
    for color, shape in [
        (True, "circle"),
        (True, "hexagon"),
        (False, "circle"),
        (False, "hexagon"),
    ]:
        fig.pygmtlogo(
            color=color,
            theme=theme,
            shape=shape,
            wordmark=False,
            position=f"g{x}/{y}+jTL+w2c",
        )
        y += 3  # noqa: PLW2901

fig.shift_origin(xshift=8)

# Logo with vertical wordmark.
fig.basemap(region=[0, 7, 0, 13], projection="x1c", frame="a1f1g1")
for x, y, theme in [(1, 3, "light"), (4, 3, "dark")]:
    for color, shape in [
        (True, "circle"),
        (True, "hexagon"),
        (False, "circle"),
        (False, "hexagon"),
    ]:
        fig.pygmtlogo(
            color=color,
            theme=theme,
            shape=shape,
            wordmark="vertical",
            position=f"g{x}/{y}+jTL+w2c",
        )
        y += 3  # noqa: PLW2901

fig.shift_origin(xshift=8)

# Logo with horizontal wordmark.
fig.basemap(region=[0, 20, 0, 13], projection="x1c", frame="a1f1g1")
for x, y, theme in [(1, 3, "light"), (11, 3, "dark")]:
    for color, shape in [
        (True, "circle"),
        (True, "hexagon"),
        (False, "circle"),
        (False, "hexagon"),
    ]:
        fig.pygmtlogo(
            color=color,
            theme=theme,
            shape=shape,
            wordmark="horizontal",
            position=f"g{x}/{y}+jTL+w0/2c",
        )
        y += 3  # noqa: PLW2901

fig.show(width=1000)
pygmt logo

Total running time of the script: (0 minutes 10.761 seconds)

Download Jupyter notebook: pygmt_logo.ipynb

Download Python source code: pygmt_logo.py

Download zipped: pygmt_logo.zip

Gallery generated by Sphinx-Gallery

Previous Next

© Copyright 2017-2025, The PyGMT Developers. Revision ff77fe83. Last updated on Aug 26, 2025.

Built with Sphinx using a theme provided by Read the Docs

This website uses Google Analytics to gather usage statistics. However, it does not use cookies or track you across different websites. Page view data are used to help us improve the site and provide an estimate of the software usage.