1
1
"""
2
2
wiggle - Plot z=f(x,y) anomalies along tracks.
3
3
"""
4
+ import warnings
5
+
4
6
from pygmt .clib import Session
7
+ from pygmt .exceptions import GMTInvalidInput
5
8
from pygmt .helpers import build_arg_string , fmt_docstring , kwargs_to_strings , use_alias
6
9
7
10
30
33
w = "wrap" ,
31
34
)
32
35
@kwargs_to_strings (R = "sequence" , c = "sequence_comma" , i = "sequence_comma" , p = "sequence" )
33
- def wiggle (self , data = None , x = None , y = None , z = None , ** kwargs ):
36
+ def wiggle (
37
+ self ,
38
+ data = None ,
39
+ x = None ,
40
+ y = None ,
41
+ z = None ,
42
+ fillpositive = None ,
43
+ fillnegative = None ,
44
+ ** kwargs
45
+ ):
34
46
r"""
35
47
Plot z=f(x,y) anomalies along tracks.
36
48
@@ -65,14 +77,12 @@ def wiggle(self, data=None, x=None, y=None, z=None, **kwargs):
65
77
**+w**\ *length*\ [**+j**\ *justify*]\ [**+al**\|\ **r**]\
66
78
[**+o**\ *dx*\ [/*dy*]][**+l**\ [*label*]].
67
79
Defines the reference point on the map for the vertical scale bar.
68
- color : str
69
- Set fill shade, color or pattern for positive and/or negative wiggles
70
- [Default is no fill]. Optionally, append **+p** to fill positive areas
71
- (this is the default behavior). Append **+n** to fill negative areas.
72
- Append **+n+p** to fill both positive and negative areas with the same
73
- fill. **Note**: You will need to repeat the color parameter to select
74
- different fills for the positive and negative wiggles.
75
-
80
+ fillpositive : str
81
+ Set fill shade, color, or pattern for positive wiggles [Default is no
82
+ fill].
83
+ fillnegative : str
84
+ Set fill shade, color, or pattern for negative wiggles [Default is no
85
+ fill].
76
86
track : str
77
87
Draw track [Default is no track]. Append pen attributes to use
78
88
[Default is ``"0.25p,black,solid"``].
@@ -94,6 +104,24 @@ def wiggle(self, data=None, x=None, y=None, z=None, **kwargs):
94
104
"""
95
105
kwargs = self ._preprocess (** kwargs ) # pylint: disable=protected-access
96
106
107
+ if (fillpositive or fillnegative ) and kwargs .get ("G" ) is not None :
108
+ raise GMTInvalidInput ("Use either fillpositive/fillnegative or color." )
109
+
110
+ if kwargs .get ("G" ) is not None :
111
+ msg = (
112
+ "The 'color' parameter has been deprecated since v0.8.0"
113
+ " and will be removed in v0.12.0. Use fillpositive/fillnegative"
114
+ " instead."
115
+ )
116
+ warnings .warn (msg , category = FutureWarning , stacklevel = 2 )
117
+
118
+ if fillpositive or fillnegative :
119
+ kwargs ["G" ] = []
120
+ if fillpositive :
121
+ kwargs ["G" ].append (fillpositive + "+p" )
122
+ if fillnegative :
123
+ kwargs ["G" ].append (fillnegative + "+n" )
124
+
97
125
with Session () as lib :
98
126
# Choose how data will be passed in to the module
99
127
file_context = lib .virtualfile_from_data (
0 commit comments