Skip to content

Commit aac61c2

Browse files
committed
Fix the weird codes in text
1 parent a9d167d commit aac61c2

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

pygmt/src/text.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,23 @@ def text_(
177177
)
178178
):
179179
kwargs.update({"F": ""})
180-
if angle is not None and isinstance(angle, (int, float, str)):
180+
181+
if angle is True:
182+
kwargs["F"] += "+a"
183+
elif isinstance(angle, (int, float, str)):
181184
kwargs["F"] += f"+a{str(angle)}"
182-
if font is not None and isinstance(font, str):
185+
186+
if font is True:
187+
kwargs["F"] += "+f"
188+
elif isinstance(font, str):
183189
kwargs["F"] += f"+f{font}"
184-
if justify is not None and isinstance(justify, str):
190+
191+
if justify is True:
192+
kwargs["F"] += "+j"
193+
elif isinstance(justify, str):
185194
kwargs["F"] += f"+j{justify}"
186-
if position is not None and isinstance(position, str):
195+
196+
if isinstance(position, str):
187197
kwargs["F"] += f'+c{position}+t"{text}"'
188198

189199
extra_arrays = []

0 commit comments

Comments
 (0)