Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3c27f6c

Browse files
committed
Remove unnecessary cast in Line3DCollection.set_segments.
The `segments` parameter is a list of lines (a line being a 2D array or list of 2-tuples), but every line is not required to be the same length. This would cause NumPy to produce an object array, but it will start to warn about ragged arrays in 1.19. An array isn't really needed as `Line3DCollection._segments3d` is only iterated over.
1 parent 0165830 commit 3c27f6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def set_segments(self, segments):
257257
"""
258258
Set 3D segments.
259259
"""
260-
self._segments3d = np.asanyarray(segments)
260+
self._segments3d = segments
261261
LineCollection.set_segments(self, [])
262262

263263
def do_3d_projection(self, renderer):

0 commit comments

Comments
 (0)