Skip to content

Commit 264784a

Browse files
committed
Set default logo size to 2-cm if not set
1 parent 2ce4d93 commit 264784a

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

pygmt/src/pygmtlogo.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import numpy as np
1212
from pygmt._typing import AnchorCode, PathLike
13+
from pygmt.exceptions import GMTValueError
1314
from pygmt.helpers import GMTTempFile, fmt_docstring
1415
from pygmt.params import Box, Position
1516

@@ -333,6 +334,20 @@ def pygmtlogo( # noqa: PLR0913
333334
>>> fig.pygmtlogo(wordmark="horizontal", position="BR", height="1c")
334335
>>> fig.show()
335336
"""
337+
# Set the default size of the visual logo to 2 cm.
338+
if width is not None and height is not None:
339+
match wordmark:
340+
case "none" | "vertical":
341+
width = width or "2c"
342+
case "horizontal":
343+
height = height or "2c"
344+
case _:
345+
raise GMTValueError(
346+
wordmark,
347+
description="value for wordmark",
348+
choices={"none", "horizontal", "vertical"},
349+
)
350+
336351
with GMTTempFile(suffix=".eps") as logofile:
337352
# Create logo file
338353
_create_logo(
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
outs:
2-
- md5: f71418c9c7566665086b6b250cc564c4
3-
size: 18618
2+
- md5: b1dee02932b292335cf5f8b95676a258
3+
size: 19161
44
hash: md5
55
path: test_pygmtlogo_circle_no_wordmark.png

0 commit comments

Comments
 (0)