Skip to content

Commit 4fc3745

Browse files
code review updates
1 parent 68b8a6c commit 4fc3745

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def _viewlim_mask(xs, ys, zs, axes):
8787
Returns
8888
-------
8989
mask : np.array
90-
The mask of the points.
90+
The mask of the points as a bool array.
9191
"""
9292
mask = np.logical_or.reduce((xs < axes.xy_viewLim.xmin,
9393
xs > axes.xy_viewLim.xmax,
@@ -178,10 +178,12 @@ def set_3d_properties(self, z=0, zdir='z', axlim_clip=False):
178178

179179
@artist.allow_rasterization
180180
def draw(self, renderer):
181-
pos3d = np.array([self._x, self._y, self._z], dtype=float)
182181
if self._axlim_clip:
183182
mask = _viewlim_mask(self._x, self._y, self._z, self.axes)
184-
pos3d[mask] = np.nan
183+
pos3d = np.ma.array([self._x, self._y, self._z],
184+
mask=mask, dtype=float).filled(np.nan)
185+
else:
186+
pos3d = np.array([self._x, self._y, self._z], dtype=float)
185187

186188
proj = proj3d._proj_trans_points([pos3d, pos3d + self._dir_vec], self.axes.M)
187189
dx = proj[0][1] - proj[0][0]

0 commit comments

Comments
 (0)