Skip to content

Commit 5644d99

Browse files
authored
Figure.velo: Deprecate parameters "color" to "fill" and "uncertaintycolor" to "uncertaintyfill" (remove in v0.12.0) (#2206)
1 parent 6a6dee6 commit 5644d99

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

pygmt/src/velo.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,25 @@
55
import pandas as pd
66
from pygmt.clib import Session
77
from pygmt.exceptions import GMTInvalidInput
8-
from pygmt.helpers import build_arg_string, fmt_docstring, kwargs_to_strings, use_alias
8+
from pygmt.helpers import (
9+
build_arg_string,
10+
deprecate_parameter,
11+
fmt_docstring,
12+
kwargs_to_strings,
13+
use_alias,
14+
)
915

1016

1117
@fmt_docstring
18+
@deprecate_parameter("color", "fill", "v0.8.0", "v0.12.0")
19+
@deprecate_parameter("uncertaintycolor", "uncertaintyfill", "v0.8.0", "v0.12.0")
1220
@use_alias(
1321
A="vector",
1422
B="frame",
1523
C="cmap",
1624
D="rescale",
17-
E="uncertaintycolor",
18-
G="color",
25+
E="uncertaintyfill",
26+
G="fill",
1927
H="scale",
2028
I="shading",
2129
J="projection",
@@ -78,8 +86,8 @@ def velo(self, data=None, **kwargs):
7886
[Default is 9p,Helvetica,black]; give **+f**\ 0 to deactivate
7987
labeling. The arrow will be drawn with the pen attributes specified
8088
by the ``pen`` parameter and the arrow-head can be colored via
81-
``color``. The ellipse will be filled with the color or shade
82-
specified by the ``uncertaintycolor`` parameter [Default is
89+
``fill``. The ellipse will be filled with the color or shade
90+
specified by the ``uncertaintyfill`` parameter [Default is
8391
transparent], and its outline will be drawn if ``line`` is selected
8492
using the pen selected (by ``pen`` if not given by ``line``).
8593
Parameters are expected to be in the following columns:
@@ -111,8 +119,8 @@ def velo(self, data=None, **kwargs):
111119
[Default is 9p,Helvetica,black]; give **+f**\ 0 to deactivate
112120
labeling. The arrow will be drawn with the pen attributes specified
113121
by the ``pen`` parameter and the arrow-head can be colored via
114-
``color``. The ellipse will be filled with the color or shade
115-
specified by the ``uncertaintycolor`` parameter [Default is
122+
``fill``. The ellipse will be filled with the color or shade
123+
specified by the ``uncertaintyfill`` parameter [Default is
116124
transparent], and its outline will be drawn if ``line`` is selected
117125
using the pen selected (by ``pen`` if not given by ``line``).
118126
Parameters are expected to be in the following columns:
@@ -130,8 +138,8 @@ def velo(self, data=None, **kwargs):
130138
*wedgescale* is not given then we read it from the data file as an
131139
extra column. Rotation values are multiplied by *wedgemag* before
132140
plotting. For example, setting *wedgemag* to 1.e7 works well for
133-
rotations of the order of 100 nanoradians/yr. Use ``color`` to set
134-
the fill color or shade for the wedge, and ``uncertaintycolor`` to
141+
rotations of the order of 100 nanoradians/yr. Use ``fill`` to set
142+
the fill color or shade for the wedge, and ``uncertaintyfill`` to
135143
set the color or shade for the uncertainty. Parameters are expected
136144
to be in the following columns:
137145
@@ -165,15 +173,15 @@ def velo(self, data=None, **kwargs):
165173
can be used to rescale the uncertainties of velocities (``spec="e"``
166174
and ``spec="r"``) and rotations (``spec="w"``). Can be combined with
167175
the ``confidence`` variable.
168-
uncertaintycolor : str
176+
uncertaintyfill : str
169177
Sets the color or shade used for filling uncertainty wedges
170178
(``spec="w"``) or velocity error ellipses (``spec="e"`` or
171-
``spec="r"``). If ``uncertaintycolor`` is not specified, the
179+
``spec="r"``). If ``uncertaintyfill`` is not specified, the
172180
uncertainty regions will be transparent. **Note**: Using ``cmap`` and
173181
``zvalue="+e"`` will update the uncertainty fill color based on the
174182
selected measure in ``zvalue`` [magnitude error]. More details at
175183
:gmt-docs:`cookbook/features.html#gfill-attrib`.
176-
color : str
184+
fill : str
177185
Select color or pattern for filling of symbols [Default is no fill].
178186
**Note**: Using ``cmap`` (and optionally ``zvalue``) will update the
179187
symbol fill color based on the selected measure in ``zvalue``

pygmt/tests/test_velo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def test_velo_pandas_dataframe(dataframe):
7777
region=[-10, 8, -10, 6],
7878
projection="x0.8c",
7979
pen="0.6p,red",
80-
uncertaintycolor="lightblue1",
80+
uncertaintyfill="lightblue1",
8181
line=True,
8282
)
8383
return fig

0 commit comments

Comments
 (0)