Skip to content

Figure.pygmtlogo: Improve positioning of vertical wordmark for circular PyGMT logo#4637

Open
seisman wants to merge 35 commits into
pygmtlogofrom
pygmtlogo-wordmark-vertical
Open

Figure.pygmtlogo: Improve positioning of vertical wordmark for circular PyGMT logo#4637
seisman wants to merge 35 commits into
pygmtlogofrom
pygmtlogo-wordmark-vertical

Conversation

@seisman

@seisman seisman commented May 13, 2026

Copy link
Copy Markdown
Member

This is a follow-up PR to #4627. See PR #4627 for additional context.

The script demonstrates two different approaches for centering the wordmark beneath the visual logo. Version 1 is simpler, but the centering is only approximate. Version 2 uses the font metrics to achieve exact centering.

import pygmt
from pygmt.params import Position

pheight = 0.739  # Height of "P"
plsb = 0.076 # Left side bearing of "P"
pstroke = 0.0735  # Stroke thickness of "P"
ydesc = 0.192  # Descender depth of "y"
pygmtwidth = 3.262   # Full width of "PyGMT"

fontsize = 8 / pygmtwidth
# fontsize = 2.2
# Version 1: Center using "TC"
x0, y0, justify = 0, -4.5, "TC"
# Version 2: Accurate centering
x0, y0, justify = -4 - fontsize * plsb, -4.5, "TL"

fig = pygmt.Figure()
fig.basemap(region=[-4, 4, -7, 4], projection="x1c", frame="ag1")
fig.pygmtlogo(width="8c", position=Position((0, 0), cstype="mapcoords", anchor="MC"))
fig.text(x=x0, y=y0, justify=justify, text="PyGMT", font=f"{fontsize}c,AvantGarde-Book", no_clip=True)
fig.hlines(y=-4.5, pen="1p,gray,-")
fig.show()
fig.savefig("logo-wordmark.png")
Version 1 Version 2
logo-wordmark logo-wordmark

Additional notes for Version 2:

  • The top of the letter G aligns at y=-4.5, rather than the tops of the letters PMT

  • Alternatively, it would also be possible to:

    • align the tops of the letters PMT at y=-4.5, or
    • vertically center the letters PMT at y=-5.5

We may also want to ensure it also works well with hexagon shape, but it's always easier to decide an initial version for circular logo first, then revise it later when working on hexagon logos.

@github-actions

github-actions Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary of changed images

This is an auto-generated report of images that have changed on the DVC remote

Status Path
added pygmt/tests/baseline/test_pygmtlogo_wordmark_vertical_circle.png
modified pygmt/tests/baseline/test_pygmtlogo_design_circle-vertical.png

Image diff(s)

Details

Added images

  • test_pygmtlogo_wordmark_vertical_circle.png

Modified images

Path Old New
test_pygmtlogo_design_circle-vertical.png

Report last updated at commit 8b7b3bb

@seisman seisman added enhancement Improving an existing feature needs review This PR has higher priority and needs review. labels May 13, 2026
@seisman seisman added this to the 0.19.0 milestone May 13, 2026
@seisman seisman removed the needs review This PR has higher priority and needs review. label May 14, 2026
@seisman seisman added the needs review This PR has higher priority and needs review. label May 14, 2026
@seisman seisman mentioned this pull request May 21, 2026
37 tasks
@seisman seisman requested a review from yvonnefroehlich June 6, 2026 06:24
Base automatically changed from pygmtlogo-font to pygmtlogo June 10, 2026 09:13

@yvonnefroehlich yvonnefroehlich left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the exact centering via version 2, with a vertical centering of "PMT" at y=-5.5.

@seisman

seisman commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

I prefer the exact centering via version 2, with a vertical centering of "PMT" at y=-5.5.

Done in 4efe98f

@seisman seisman changed the title Figure.pygmtlogo: Improved positioning of vertical wordmark for circular PyGMT logo Figure.pygmtlogo: Improve positioning of vertical wordmark for circular PyGMT logo Jun 11, 2026
@seisman seisman deployed to pr-tests June 12, 2026 12:07 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improving an existing feature needs review This PR has higher priority and needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants