Skip to content

Figure.plot3d: Reorder input parameters to 'data, x, y, z' #1560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pygmt/src/plot3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import (
build_arg_string,
check_data_input_order,
data_kind,
deprecate_parameter,
fmt_docstring,
Expand All @@ -18,6 +19,7 @@
@fmt_docstring
@deprecate_parameter("columns", "incols", "v0.4.0", remove_version="v0.6.0")
@deprecate_parameter("sizes", "size", "v0.4.0", remove_version="v0.6.0")
@check_data_input_order("v0.5.0", remove_version="v0.7.0")
@use_alias(
A="straight_line",
B="frame",
Expand Down Expand Up @@ -54,7 +56,7 @@
)
@kwargs_to_strings(R="sequence", c="sequence_comma", i="sequence_comma", p="sequence")
def plot3d(
self, x=None, y=None, z=None, data=None, size=None, direction=None, **kwargs
self, data=None, x=None, y=None, z=None, size=None, direction=None, **kwargs
):
r"""
Plot lines, polygons, and symbols in 3-D.
Expand Down Expand Up @@ -83,13 +85,13 @@ def plot3d(

Parameters
----------
x/y/z : float or 1d arrays
The x, y, and z coordinates, or arrays of x, y and z coordinates of
the data points
data : str or {table-like}
Either a data file name, a 2d {table-classes}.
Optionally, use parameter ``incols`` to specify which columns are x, y,
z, color, and size, respectively.
x/y/z : float or 1d arrays
The x, y, and z coordinates, or arrays of x, y and z coordinates of
the data points
size : 1d array
The size of the data points in units specified in ``style``.
Only valid if using ``x``/``y``/``z``.
Expand Down
6 changes: 3 additions & 3 deletions pygmt/tests/test_plot3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def test_plot3d_matrix(data, region):
"""
fig = Figure()
fig.plot3d(
data=data,
data,
zscale=5,
perspective=[225, 30],
region=region,
Expand All @@ -343,7 +343,7 @@ def test_plot3d_matrix_color(data, region):
"""
fig = Figure()
fig.plot3d(
data=data,
data,
zscale=5,
perspective=[225, 30],
region=region,
Expand Down Expand Up @@ -464,7 +464,7 @@ def test_plot3d_deprecate_columns_to_incols(data, region):
fig = Figure()
with pytest.warns(expected_warning=FutureWarning) as record:
fig.plot3d(
data=data,
data,
zscale=5,
perspective=[225, 30],
region=region,
Expand Down