Skip to content

Commit 2fda01e

Browse files
committed
Implement full clipping for Patch3D
1 parent 341809c commit 2fda01e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,9 +607,11 @@ def get_path(self):
607607
def do_3d_projection(self):
608608
s = self._segment3d
609609
if self._axlim_clip:
610-
mask = _viewlim_mask(*zip(*s), self.axes)
611-
xs, ys, zs = np.ma.array(zip(*s),
612-
dtype=float, mask=mask).filled(np.nan)
610+
clipped = _clip_to_axes_bbox(self.axes, [s])
611+
if not clipped:
612+
self._path2d = mpath.Path(np.empty((0, 2)))
613+
return 0
614+
xs, ys, zs = clipped[0].T
613615
else:
614616
xs, ys, zs = zip(*s)
615617
vxs, vys, vzs, vis = proj3d._proj_transform_clip(xs, ys, zs,

0 commit comments

Comments
 (0)