There was an error while loading. Please reload this page.
1 parent 68b8a6c commit 4fc3745Copy full SHA for 4fc3745
1 file changed
lib/mpl_toolkits/mplot3d/art3d.py
@@ -87,7 +87,7 @@ def _viewlim_mask(xs, ys, zs, axes):
87
Returns
88
-------
89
mask : np.array
90
- The mask of the points.
+ The mask of the points as a bool array.
91
"""
92
mask = np.logical_or.reduce((xs < axes.xy_viewLim.xmin,
93
xs > axes.xy_viewLim.xmax,
@@ -178,10 +178,12 @@ def set_3d_properties(self, z=0, zdir='z', axlim_clip=False):
178
179
@artist.allow_rasterization
180
def draw(self, renderer):
181
- pos3d = np.array([self._x, self._y, self._z], dtype=float)
182
if self._axlim_clip:
183
mask = _viewlim_mask(self._x, self._y, self._z, self.axes)
184
- pos3d[mask] = np.nan
+ pos3d = np.ma.array([self._x, self._y, self._z],
+ mask=mask, dtype=float).filled(np.nan)
185
+ else:
186
+ pos3d = np.array([self._x, self._y, self._z], dtype=float)
187
188
proj = proj3d._proj_trans_points([pos3d, pos3d + self._dir_vec], self.axes.M)
189
dx = proj[0][1] - proj[0][0]
0 commit comments