Skip to content

Commit

Permalink
code review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
scottshambaugh committed Jan 27, 2025
1 parent 68b8a6c commit 4fc3745
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/mpl_toolkits/mplot3d/art3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def _viewlim_mask(xs, ys, zs, axes):
Returns
-------
mask : np.array
The mask of the points.
The mask of the points as a bool array.
"""
mask = np.logical_or.reduce((xs < axes.xy_viewLim.xmin,
xs > axes.xy_viewLim.xmax,
Expand Down Expand Up @@ -178,10 +178,12 @@ def set_3d_properties(self, z=0, zdir='z', axlim_clip=False):

@artist.allow_rasterization
def draw(self, renderer):
pos3d = np.array([self._x, self._y, self._z], dtype=float)
if self._axlim_clip:
mask = _viewlim_mask(self._x, self._y, self._z, self.axes)
pos3d[mask] = np.nan
pos3d = np.ma.array([self._x, self._y, self._z],
mask=mask, dtype=float).filled(np.nan)
else:
pos3d = np.array([self._x, self._y, self._z], dtype=float)

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

0 comments on commit 4fc3745

Please sign in to comment.