8000 add set_data_3d method to Line3D · Raab70/matplotlib@a92dff4 · GitHub
[go: up one dir, main page]

Skip to content

Commit a92dff4

Browse files
committed
add set_data_3d method to Line3D
1 parent 0f6d9f9 commit a92dff4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,21 @@ def set_3d_properties(self, zs=0, zdir='z'):
151151
self._verts3d = juggle_axes(xs, ys, zs, zdir)
152152
self.stale = True
153153

154+
def set_data_3d(self, *args):
155+
"""
156+
Set the x, y and z data
157+
158+
ACCEPTS: 3D array (rows are x, y, z) or three 1D arrays
159+
"""
160+
if len(args) == 1:
161+
x, y, z = args[0]
162+
else:
163+
x, y, z = args
164+
165+
self.set_xdata(x)
166+
self.set_ydata(y)
167+
self.set_3d_properties(zs=z)
168+
154169
@artist.allow_rasterization
155170
def draw(self, renderer):
156171
xs3d, ys3d, zs3d = self._verts3d

0 commit comments

Comments
 (0)
0