Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
88f381a
Allow adjust font
seisman May 7, 2026
6abbcfd
Merge branch 'pygmtlogo' into pygmtlogo-font
seisman May 9, 2026
5693140
Merge branch 'pygmtlogo' into pygmtlogo-font
seisman May 12, 2026
7b9f053
Revert "Allow adjust font"
seisman May 12, 2026
6cdbc34
Figure.pygmtlogo: Accurate positioning of the horizontal wordmark
seisman May 13, 2026
a8330fd
Add debugging lines for horizontal wordmark
seisman May 13, 2026
f03bd50
Smaller region for horizontal wordmark
seisman May 13, 2026
479cb58
Update the baseline image for horizontal wordmark design
seisman May 13, 2026
3f9affe
Reorder variables
seisman May 13, 2026
25ac028
Figure.pygmtlogo: Improved positioning of vertical wordmark for circu…
seisman May 13, 2026
834ea25
Fix a typo
seisman May 13, 2026
be6c052
Add a test and baseline image for circular logo with horizontal wordmark
seisman May 13, 2026
0bad58f
Merge branch 'pygmtlogo' into pygmtlogo-font
seisman May 13, 2026
6988c0f
Update baseline images
seisman May 14, 2026
2c94cf4
Merge branch 'pygmtlogo-font' into pygmtlogo-wordmark-vertical
seisman May 14, 2026
f6d08a0
Simplify the test script
seisman May 14, 2026
7eaf145
Merge branch 'pygmtlogo-font' into pygmtlogo-wordmark-vertical
seisman May 14, 2026
27882b5
Add a test and baseline images
seisman May 14, 2026
3fdfb56
Figure.pygmtlogo: Parameterize existing tests
seisman May 14, 2026
b29bdc9
Remove two dvc files
seisman May 14, 2026
b4e1e38
Rename test_pygmtlogo_no_wordmark to test_pygmtlogo_wordmark_none
seisman May 14, 2026
e5f0af1
Merge branch 'pygmtlogo-parameterize' into pygmtlogo-font
seisman May 14, 2026
089d334
Remove one unused dvc file
seisman May 14, 2026
645ec10
Fix a typo
seisman May 14, 2026
678dabe
Merge branch 'pygmtlogo' into pygmtlogo-font
seisman May 14, 2026
afd9669
Merge branch 'pygmtlogo-font' into pygmtlogo-wordmark-vertical
seisman May 14, 2026
d47cda6
Update tests and baseline images
seisman May 14, 2026
166f2ef
Update baseline image for logo design
seisman May 14, 2026
c8c8c88
Merge branch 'pygmtlogo' into pygmtlogo-font
seisman May 23, 2026
05c862b
Merge branch 'pygmtlogo-font' into pygmtlogo-wordmark-vertical
seisman May 23, 2026
d1e37f3
Merge branch 'pygmtlogo' into pygmtlogo-font
seisman Jun 6, 2026
09060f7
Merge branch 'pygmtlogo-font' into pygmtlogo-wordmark-vertical
seisman Jun 6, 2026
17da67d
Merge branch 'pygmtlogo' into pygmtlogo-wordmark-vertical
seisman Jun 10, 2026
4efe98f
Fix the center of the wordmark to -5.5
seisman Jun 10, 2026
8b7b3bb
Merge branch 'pygmtlogo' into pygmtlogo-wordmark-vertical
seisman Jun 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion pygmt/src/pygmtlogo.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,19 @@ def _create_logo( # noqa: PLR0915
pheight = 0.739 # Height of letter "P"
plsb = 0.076 # Left side bearing of letter "P"
pstroke = 0.0735 # Stroke thickness of letter "P"
pygmtwidth = 3.262 # Full width of "PyGMT"

match wordmark:
case "vertical":
args_wordmark = {"x": 0, "y": -4.5, "justify": "CT", "font": f"2.4c,{font}"}
# Ensure the same width for the visual logo and wordmark
fontsize = size * 2.0 / pygmtwidth
args_wordmark = {
"x": -size - fontsize * plsb,
"y": -size * 1.375, # Center of the wordmark.
"justify": "ML",
"font": f"{fontsize}c,{font}",
"no_clip": True, # Needed because x<xmin.
}
case "horizontal":
# The stroke width matches the outline thickness.
# The left edge of "P" is aligned at y=size * 1.25.
Expand Down Expand Up @@ -257,6 +266,8 @@ def _compass_lines():
halfheight = pheight / 2.0 * fontsize
fig.hlines(y=[-halfheight, halfheight], xmin=size, pen=pen)
fig.vlines(x=[size * 1.25, size * 1.25 + pstroke * fontsize], pen=pen)
elif wordmark == "vertical":
fig.hlines(y=-size * 1.375, pen=pen)

if figname:
fig.savefig(fname=figname)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
outs:
- md5: 5ee82660f20bc8424f3051af4f9fb9ac
size: 173671
- md5: 4b7c27283350dd435d7e5d3c94767a2c
size: 174973
hash: md5
path: test_pygmtlogo_design_circle-vertical.png
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
outs:
- md5: 3e001517210b78b2dfdd2c1fce8b104a
size: 40772
hash: md5
path: test_pygmtlogo_wordmark_vertical_circle.png
29 changes: 29 additions & 0 deletions pygmt/tests/test_pygmtlogo.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,32 @@ def test_pygmtlogo_wordmark_horizontal(shape):
wordmark="horizontal",
)
return fig


@pytest.mark.mpl_image_compare
@pytest.mark.parametrize("shape", ["circle"])
def test_pygmtlogo_wordmark_vertical(shape):
"""
Test the PyGMT logo with a vertical wordmark, including both light/dark themes,
and colored/black-and-white versions.
"""
fig = Figure()
fig.basemap(
region=[-0.5, 5.0, -0.5, 5.5],
projection="x1c",
frame=Frame(fill="gray", axis=Axis(grid=0.5)),
)
for (x, y), theme, color in [
((1.0, 4.0), "light", True),
((3.5, 4.0), "dark", True),
((1.0, 1.0), "light", False),
((3.5, 1.0), "dark", False),
]:
fig.pygmtlogo(
position=Position((x, y), anchor="CM", cstype="mapcoords"),
theme=theme,
color=color,
shape=shape,
wordmark="vertical",
)
return fig
Loading