@@ -579,7 +579,7 @@ def get_vector(self, segments3d):
579
579
"""Optimize points for projection."""
580
580
# segments3d.shape == (num_faces, num_vertices, 3)
581
581
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 , \
583
583
"Incorrect shape of vertices of Poly3DCollection"
584
584
self ._segments = segments3d
585
585
else :
@@ -648,9 +648,11 @@ def do_3d_projection(self, renderer):
648
648
else :
649
649
cedge = cedge .repeat (num_faces , axis = 0 )
650
650
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
654
656
face_order = np .argsort (face_z , axis = - 1 )[::- 1 ]
655
657
656
658
if self ._codes3d is not None :
0 commit comments