Skip to content
Draft
6 changes: 3 additions & 3 deletions pygmt/src/pygmtlogo.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _create_logo( # noqa: PLR0915
hex_factor = 1.0
case "hexagon":
symbol = "h"
size_shape = (r0 + 0.34) * 2
size_shape = (r0 + r1) / np.cos(np.deg2rad(30))
hex_factor = 1.1

# Define wordmark
Expand All @@ -93,7 +93,7 @@ def _create_logo( # noqa: PLR0915
fontsize = size * 2.0 / pygmtwidth
args_wordmark = {
"x": -size - fontsize * plsb,
"y": -size * 1.375, # Center of the wordmark.
"y": -size * (1.375 if shape == "circle" else 1.5),
"justify": "ML",
"font": f"{fontsize}c,{font}",
"no_clip": True, # Needed because x<xmin.
Expand Down Expand Up @@ -266,7 +266,7 @@ 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":
elif wordmark == "vertical" and shape == "circle":
fig.hlines(y=-size * 1.375, pen=pen)

if figname:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
outs:
- md5: 1ab652c5ba076ee29a0c1c1c336bf281
size: 357515
hash: md5
path: test_pygmtlogo_design_hexagon-horizontal.png
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
outs:
- md5: c917b7e40da71eed0e05a8525ddc2e56
size: 196043
hash: md5
path: test_pygmtlogo_design_hexagon-vertical.png
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
outs:
- md5: a2af1063edc39f78976bce5a6ff76bef
size: 55897
hash: md5
path: test_pygmtlogo_wordmark_horizontal_hexagon.png
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
outs:
- md5: f821a40456a61abe7859685cc90080a9
size: 28794
hash: md5
path: test_pygmtlogo_wordmark_none_hexagon.png
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
outs:
- md5: 56740518206c886f12656a31a953b003
size: 37585
hash: md5
path: test_pygmtlogo_wordmark_vertical_hexagon.png
8 changes: 4 additions & 4 deletions pygmt/tests/test_pygmtlogo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@pytest.mark.mpl_image_compare(savefig_kwargs={"dpi": 600})
@pytest.mark.parametrize("wordmark", ["horizontal", "vertical"])
@pytest.mark.parametrize("shape", ["circle"])
@pytest.mark.parametrize("shape", ["circle", "hexagon"])
def test_pygmtlogo_design(shape, wordmark):
"""
Test the design details of the PyGMT logo with a wordmark.
Expand All @@ -24,7 +24,7 @@ def test_pygmtlogo_design(shape, wordmark):


@pytest.mark.mpl_image_compare
@pytest.mark.parametrize("shape", ["circle"])
@pytest.mark.parametrize("shape", ["circle", "hexagon"])
def test_pygmtlogo_wordmark_none(shape):
"""
Test the PyGMT logo without the wordmark, including both light/dark themes, and
Expand Down Expand Up @@ -52,7 +52,7 @@ def test_pygmtlogo_wordmark_none(shape):


@pytest.mark.mpl_image_compare
@pytest.mark.parametrize("shape", ["circle"])
@pytest.mark.parametrize("shape", ["circle", "hexagon"])
def test_pygmtlogo_wordmark_horizontal(shape):
"""
Test the PyGMT logo with a horizontal wordmark, including both light/dark themes,
Expand Down Expand Up @@ -81,7 +81,7 @@ def test_pygmtlogo_wordmark_horizontal(shape):


@pytest.mark.mpl_image_compare
@pytest.mark.parametrize("shape", ["circle"])
@pytest.mark.parametrize("shape", ["circle", "hexagon"])
def test_pygmtlogo_wordmark_vertical(shape):
"""
Test the PyGMT logo with a vertical wordmark, including both light/dark themes,
Expand Down
Loading