Skip to content

Commit b9eb627

Browse files
authored
Figure.plot3d: Reorder input parameters to 'data, x, y, z' (#1560)
* Update plot3d.py * adjust tests
1 parent a553d68 commit b9eb627

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

pygmt/src/plot3d.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from pygmt.exceptions import GMTInvalidInput
66
from pygmt.helpers import (
77
build_arg_string,
8+
check_data_input_order,
89
data_kind,
910
deprecate_parameter,
1011
fmt_docstring,
@@ -18,6 +19,7 @@
1819
@fmt_docstring
1920
@deprecate_parameter("columns", "incols", "v0.4.0", remove_version="v0.6.0")
2021
@deprecate_parameter("sizes", "size", "v0.4.0", remove_version="v0.6.0")
22+
@check_data_input_order("v0.5.0", remove_version="v0.7.0")
2123
@use_alias(
2224
A="straight_line",
2325
B="frame",
@@ -54,7 +56,7 @@
5456
)
5557
@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence")
5658
def plot3d(
57-
self, x=None, y=None, z=None, data=None, size=None, direction=None, **kwargs
59+
self, data=None, x=None, y=None, z=None, size=None, direction=None, **kwargs
5860
):
5961
r"""
6062
Plot lines, polygons, and symbols in 3-D.
@@ -83,13 +85,13 @@ def plot3d(
8385
8486
Parameters
8587
----------
86-
x/y/z : float or 1d arrays
87-
The x, y, and z coordinates, or arrays of x, y and z coordinates of
88-
the data points
8988
data : str or {table-like}
9089
Either a data file name, a 2d {table-classes}.
9190
Optionally, use parameter ``incols`` to specify which columns are x, y,
9291
z, color, and size, respectively.
92+
x/y/z : float or 1d arrays
93+
The x, y, and z coordinates, or arrays of x, y and z coordinates of
94+
the data points
9395
size : 1d array
9496
The size of the data points in units specified in ``style``.
9597
Only valid if using ``x``/``y``/``z``.

pygmt/tests/test_plot3d.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def test_plot3d_matrix(data, region):
319319
"""
320320
fig = Figure()
321321
fig.plot3d(
322-
data=data,
322+
data,
323323
zscale=5,
324324
perspective=[225, 30],
325325
region=region,
@@ -343,7 +343,7 @@ def test_plot3d_matrix_color(data, region):
343343
"""
344344
fig = Figure()
345345
fig.plot3d(
346-
data=data,
346+
data,
347347
zscale=5,
348348
perspective=[225, 30],
349349
region=region,
@@ -464,7 +464,7 @@ def test_plot3d_deprecate_columns_to_incols(data, region):
464464
fig = Figure()
465465
with pytest.warns(expected_warning=FutureWarning) as record:
466466
fig.plot3d(
467-
data=data,
467+
data,
468468
zscale=5,
469469
perspective=[225, 30],
470470
region=region,

0 commit comments

Comments
 (0)