8000 remove juggle_3d and update to numpydoc · matplotlib/matplotlib@635e5dc · GitHub
[go: up one dir, main page]

Skip to content

Commit 635e5dc

Browse files
committed
remove juggle_3d and update to numpydoc
1 parent 93ac991 commit 635e5dc

File tree

2 files changed

+32
-8
lines changed

2 files changed

+32
-8
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,20 +155,32 @@ def set_data_3d(self, *args):
155155
"""
156156
Set the x, y and z data
157157
158-
ACCEPTS: 3D array (rows are x, y, z) or three 1D arrays
158+
Parameters
159+
----------
160+
x : array_like
161+
The x-data to be plotted
162+
y : array_like
163+
The y-data to be plotted
164+
z : array_like
165+
The z-data to be plotted
166+
167+
Notes
168+
-----
169+
Accepts x, y, z arguments or a single array_like (x, y, z)
159170
"""
160171
if len(args) == 1:
161-
x, y, z = args[0]
172+
self._verts3d = args[0]
162173
else:
163-
x, y, z = args
164-
165-
self.set_xdata(x)
166-
self.set_ydata(y)
167-
self.set_3d_properties(zs=z)
174+
self._verts3d = args
168175

169176
def get_data_3d(self):
170177
"""
171-
Return the xdata, ydata, zdata.
178+
Get the current data
179+
180+
Returns
181+
-------
182+
verts3d : length-3 tuple or array_likes
183+
The current data as a tuple or array_likes
172184
"""
173185
return self._verts3d
174186

lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,18 @@ def test_calling_conventions(self):
765765
ax.voxels(filled=filled, x=x, y=y, z=z)
766766

767767

768+
def test_line3d_set_get_data_3d():
769+
x, y, z = [0, 1], [2, 3], [4, 5]
770+
x2, y2, z2 = [6, 7], [8, 9], [10, 11]
771+
fig = plt.figure()
772+
ax = fig.add_subplot(111, projection='3d')
773+
lines = ax.plot(x, y, z)
774+
line = lines[0]
775+
np.testing.assert_array_equal((x, y, z), line.get_data_3d())
776+
line.set_data_3d(x2, y2, z2)
777+
np.testing.assert_array_equal((x2, y2, z2), line.get_data_3d())
778+
779+
768780
def test_inverted_cla():
769781
# Github PR #5450. Setting autoscale should reset
770782
# axes to be non-inverted.

0 commit comments

Comments
 (0)
0