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

Skip to content

Commit ca129ae

Browse files
committed
Minor fixes
1 parent ed05556 commit ca129ae

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ def get_vector(self, segments3d):
579579
"""Optimize points for projection."""
580580
# segments3d.shape == (num_faces, num_vertices, 3)
581581
if isinstance(segments3d, np.ndarray):
582-
assert segments3d.dim == 3 and segments3d.shape[-1] == 3, \
582+
assert segments3d.ndim == 3 and segments3d.shape[-1] == 3, \
583583
"Incorrect shape of vertices of Poly3DCollection"
584584
self._segments = segments3d
585585
else:
@@ -648,9 +648,11 @@ def do_3d_projection(self, renderer):
648648
else:
649649
cedge = cedge.repeat(num_faces, axis=0)
650650

651-
# NOTE: Unpacking .data is safe here, because every face has to contain
652-
# a valid vertex.
653-
face_z = self._zsortfunc(psegments[..., 2], axis=-1).data
651+
face_z = self._zsortfunc(psegments[..., 2], axis=-1)
652+
if isinstance(face_z, np.ma.MaskedArray):
653+
# NOTE: Unpacking .data is safe here, because every face has to contain
654+
# a valid vertex.
655+
face_z = face_z.data
654656
face_order = np.argsort(face_z, axis=-1)[::-1]
655657

656658
if self._codes3d is not None:

0 commit comments

Comments
 (0)