Skip to content

Commit bb99f7a

Browse files
authored
Figure.plot3d: Deprecate parameter "color" to "fill" (remove in v0.12.0) (#2178)
1 parent 93b2426 commit bb99f7a

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

pygmt/src/plot3d.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from pygmt.helpers import (
77
build_arg_string,
88
data_kind,
9+
deprecate_parameter,
910
fmt_docstring,
1011
is_nonstr_iter,
1112
kwargs_to_strings,
@@ -15,12 +16,13 @@
1516

1617

1718
@fmt_docstring
19+
@deprecate_parameter("color", "fill", "v0.8.0", "v0.12.0")
1820
@use_alias(
1921
A="straight_line",
2022
B="frame",
2123
C="cmap",
2224
D="offset",
23-
G="color",
25+
G="fill",
2426
I="intensity",
2527
J="projection",
2628
Jz="zscale",
@@ -61,7 +63,7 @@ def plot3d(
6163
6264
Must provide either ``data`` or ``x``/``y``/``z``.
6365
64-
If providing data through ``x/y/z``, ``color`` can be a 1d array
66+
If providing data through ``x/y/z``, ``fill`` can be a 1d array
6567
that will be mapped to a colormap.
6668
6769
If a symbol is selected and no symbol size given, then plot3d will
@@ -70,8 +72,8 @@ def plot3d(
7072
symbol code (see ``style`` below) must be present as last column in the
7173
input. If ``style`` is not used, a line connecting the data points will
7274
be drawn instead. To explicitly close polygons, use ``close``. Select a
73-
fill with ``color``. If ``color`` is set, ``pen`` will control whether the
74-
polygon outline is drawn or not. If a symbol is selected, ``color`` and
75+
fill with ``fill``. If ``fill`` is set, ``pen`` will control whether the
76+
polygon outline is drawn or not. If a symbol is selected, ``fill`` and
7577
``pen`` determines the fill and outline/no outline, respectively.
7678
7779
Full option list at :gmt-docs:`plot3d.html`
@@ -83,7 +85,7 @@ def plot3d(
8385
data : str or {table-like}
8486
Either a data file name, a 2d {table-classes}.
8587
Optionally, use parameter ``incols`` to specify which columns are x, y,
86-
z, color, and size, respectively.
88+
z, fill, and size, respectively.
8789
x/y/z : float or 1d arrays
8890
The x, y, and z coordinates, or arrays of x, y and z coordinates of
8991
the data points
@@ -117,8 +119,8 @@ def plot3d(
117119
*dx*/*dy*\ [/*dz*].
118120
Offset the plot symbol or line locations by the given amounts
119121
*dx*/*dy*\ [/*dz*] [Default is no offset].
120-
{color}
121-
*color* can be a 1d array, but it is only valid if using ``x``/``y``
122+
{fill}
123+
*fill* can be a 1d array, but it is only valid if using ``x``/``y``
122124
and ``cmap=True`` is also required.
123125
intensity : float or bool or 1d array
124126
Provide an *intensity* value (nominally in the -1 to +1 range) to
@@ -158,11 +160,11 @@ def plot3d(
158160
zvalue : str
159161
*value*\|\ *file*.
160162
Instead of specifying a symbol or polygon fill and outline color
161-
via ``color`` and ``pen``, give both a *value* via **zvalue** and a
163+
via ``fill`` and ``pen``, give both a *value* via **zvalue** and a
162164
color lookup table via ``cmap``. Alternatively, give the name of a
163165
*file* with one z-value (read from the last column) for each
164166
polygon in the input data. To apply it to the fill color, use
165-
``color="+z"``. To apply it to the pen color, append **+z** to
167+
``fill="+z"``. To apply it to the pen color, append **+z** to
166168
``pen``.
167169
{aspatial}
168170
{binary}
@@ -208,7 +210,7 @@ def plot3d(
208210
if kwargs.get("G") is not None and is_nonstr_iter(kwargs["G"]):
209211
if kind != "vectors":
210212
raise GMTInvalidInput(
211-
"Can't use arrays for color if data is matrix or file."
213+
"Can't use arrays for fill if data is matrix or file."
212214
)
213215
extra_arrays.append(kwargs["G"])
214216
del kwargs["G"]

0 commit comments

Comments
 (0)