Skip to content

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

Merged
seisman merged 35 commits into
pygmtlogofrom
pygmtlogo-wordmark-vertical
Jun 16, 2026
Merged

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

Conversation

@seisman

@seismanseisman 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.

importpygmtfrompygmt.paramsimportPositionpheight=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 centeringx0, 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 1Version 2
logo-wordmarklogo-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-actionsBot 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

StatusPath
addedpygmt/tests/baseline/test_pygmtlogo_wordmark_vertical_circle.png
modifiedpygmt/tests/baseline/test_pygmtlogo_design_circle-vertical.png

Image diff(s)

Details

Added images

  • test_pygmtlogo_wordmark_vertical_circle.png

Modified images

PathOldNew
test_pygmtlogo_design_circle-vertical.png

Report last updated at commit 8b7b3bb

@seismanseisman added enhancement Improving an existing feature needs review This PR has higher priority and needs review. labels May 13, 2026
@seismanseisman added this to the 0.19.0 milestone May 13, 2026
@seismanseisman added the needs review This PR has higher priority and needs review. label May 14, 2026
@seismanseisman mentioned this pull request May 21, 2026
43 tasks
Base automatically changed from pygmtlogo-font to pygmtlogoJune 10, 2026 09:13

@yvonnefroehlichyvonnefroehlich 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

Copy link
Copy Markdown
MemberAuthor

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

Done in 4efe98f

@seismanseisman changed the title Figure.pygmtlogo: Improved positioning of vertical wordmark for circular PyGMT logoFigure.pygmtlogo: Improve positioning of vertical wordmark for circular PyGMT logoJun 11, 2026
@seismanseisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Jun 15, 2026
@seisman
seisman merged commit ce7a3c4 into pygmtlogoJun 16, 2026
23 checks passed
@seisman
seisman deleted the pygmtlogo-wordmark-vertical branch June 16, 2026 02:40
@seismanseisman removed the final review call This PR requires final review and approval from a second reviewer label Jun 16, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementImproving an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@seisman@yvonnefroehlich