5
5
import pandas as pd
6
6
from packaging .version import Version
7
7
from pygmt ._typing import PathLike , TableLike
8
+ from pygmt .alias import Alias , AliasSystem
8
9
from pygmt .clib import Session , __gmt_version__
9
10
from pygmt .helpers import build_arg_list , fmt_docstring , kwargs_to_strings , use_alias
10
11
14
15
B = "frame" ,
15
16
C = "cmap" ,
16
17
G = "fill" ,
17
- L = "alabel/blabel/clabel-" ,
18
18
JX = "width" ,
19
19
R = "region" ,
20
20
S = "style" ,
@@ -47,6 +47,7 @@ def ternary(
47
47
Full GMT docs at :gmt-docs:`ternary.html`.
48
48
49
49
{aliases}
50
+ - L=alabel/blabel/clabel
50
51
51
52
Parameters
52
53
----------
@@ -85,9 +86,12 @@ def ternary(
85
86
self ._activate_figure ()
86
87
87
88
# -Lalabel/blabel/clabel. '-' means skipping the label.
88
- labels = (alabel , blabel , clabel )
89
- if any (v is not None for v in labels ):
90
- kwargs ["L" ] = "/" .join (str (v ) if v is not None else "-" for v in labels )
89
+ _labels = [v if v is not None else "-" for v in (alabel , blabel , clabel )]
90
+ labels = _labels if any (v != "-" for v in _labels ) else None
91
+
92
+ aliasdict = AliasSystem (
93
+ L = Alias (labels , name = "alabel/blabel/clabel" , sep = "/" , size = 3 ),
94
+ ).merge (kwargs )
91
95
92
96
# TODO(GMT>=6.5.0): Remove the patch for upstream bug fixed in GMT 6.5.0.
93
97
# See https://github.com/GenericMappingTools/pygmt/pull/2138
@@ -98,5 +102,5 @@ def ternary(
98
102
with lib .virtualfile_in (check_kind = "vector" , data = data ) as vintbl :
99
103
lib .call_module (
100
104
module = "ternary" ,
101
- args = build_arg_list (kwargs , infile = vintbl ),
105
+ args = build_arg_list (aliasdict , infile = vintbl ),
102
106
)
0 commit comments