8
8
from pygmt .helpers import build_arg_list , fmt_docstring , kwargs_to_strings , use_alias
9
9
10
10
11
+ def _parse_fills (fillpositive , fillnegative ):
12
+ """
13
+ Parse the fillpositive and fillnegative parameters.
14
+
15
+ >>> _parse_fills("red", "blue")
16
+ ['red+p', 'blue+n']
17
+ >>> _parse_fills(None, "blue")
18
+ ['blue+n']
19
+ >>> _parse_fills("red", None)
20
+ ['red+p']
21
+ >>> _parse_fills(None, None)
22
+ """
23
+ _fills = []
24
+ if fillpositive :
25
+ _fills .append (fillpositive + "+p" )
26
+ if fillnegative :
27
+ _fills .append (fillnegative + "+n" )
28
+ return _fills or None
29
+
30
+
11
31
@fmt_docstring
12
32
@use_alias (
13
33
B = "frame" ,
14
34
D = "position" ,
15
- G = "fillpositive/fillnegative-" ,
16
35
R = "region" ,
17
36
T = "track" ,
18
37
V = "verbose" ,
@@ -53,6 +72,7 @@ def wiggle(
53
72
Full GMT docs at :gmt-docs:`wiggle.html`.
54
73
55
74
{aliases}
75
+ - G=**+p**: fillpositive, **+n**: fillnegative
56
76
- J=projection
57
77
58
78
Parameters
@@ -78,11 +98,9 @@ def wiggle(
78
98
[**+o**\ *dx*\ [/*dy*]][**+l**\ [*label*]].
79
99
Define the reference point on the map for the vertical scale bar.
80
100
fillpositive : str
81
- Set color or pattern for filling positive wiggles
82
- [Default is no fill].
101
+ Set color or pattern for filling positive wiggles [Default is no fill].
83
102
fillnegative : str
84
- Set color or pattern for filling negative wiggles
85
- [Default is no fill].
103
+ Set color or pattern for filling negative wiggles [Default is no fill].
86
104
track : str
87
105
Draw track [Default is no track]. Append pen attributes to use
88
106
[Default is ``"0.25p,black,solid"``].
@@ -103,15 +121,11 @@ def wiggle(
103
121
"""
104
122
self ._activate_figure ()
105
123
106
- if fillpositive or fillnegative :
107
- kwargs ["G" ] = []
108
- if fillpositive :
109
- kwargs ["G" ].append (fillpositive + "+p" )
110
- if fillnegative :
111
- kwargs ["G" ].append (fillnegative + "+n" )
124
+ _fills = _parse_fills (fillpositive , fillnegative )
112
125
113
126
aliasdict = AliasSystem (
114
127
J = Alias (projection , name = "projection" ),
128
+ G = Alias (_fills , name = "fillpositive/fillnegative" ),
115
129
).merge (kwargs )
116
130
117
131
with Session () as lib :
0 commit comments