Skip to content

Commit 7fa373e

Browse files
Make zoom and dist private attrs
1 parent 84c1392 commit 7fa373e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ def convert_zunits(self, z):
198198
def set_top_view(self):
199199
# this happens to be the right view for the viewing coordinates
200200
# moved up and to the left slightly to fit labels and axes
201-
xdwl = 0.95 / self.dist
202-
xdw = 0.9 / self.dist
203-
ydwl = 0.95 / self.dist
204-
ydw = 0.9 / self.dist
201+
xdwl = 0.95 / self._dist
202+
xdw = 0.9 / self._dist
203+
ydwl = 0.95 / self._dist
204+
ydw = 0.9 / self._dist
205205
# This is purposely using the 2D Axes's set_xlim and set_ylim,
206206
# because we are trying to place our viewing pane.
207207
super().set_xlim(-xdwl, xdw, auto=None)
@@ -356,15 +356,15 @@ def set_box_aspect(self, aspect, *, zoom=1):
356356
"""
357357
if zoom <= 0:
358358
raise ValueError(f'Argument zoom = {zoom} must be > 0')
359-
self.zoom = zoom
359+
self._zoom = zoom
360360

361361
if aspect is None:
362362
aspect = np.asarray((4, 4, 3), dtype=float)
363363
else:
364364
aspect = np.asarray(aspect, dtype=float)
365365
_api.check_shape((3,), aspect=aspect)
366366
# default scale tuned to match the mpl32 appearance.
367-
aspect *= 1.8294640721620434 * self.zoom / np.linalg.norm(aspect)
367+
aspect *= 1.8294640721620434 * self._zoom / np.linalg.norm(aspect)
368368

369369
self._box_aspect = aspect
370370
self.stale = True
@@ -1009,7 +1009,7 @@ def view_init(self, elev=None, azim=None, roll=None, vertical_axis="z"):
10091009
The axis to align vertically. *azim* rotates about this axis.
10101010
"""
10111011

1012-
self.dist = 10 # The camera distance from origin. Behaves like zoom
1012+
self._dist = 10 # The camera distance from origin. Behaves like zoom
10131013

10141014
if elev is None:
10151015
self.elev = self.initial_elev
@@ -1084,7 +1084,7 @@ def get_proj(self):
10841084

10851085
# The coordinates for the eye viewing point. The eye is looking
10861086
# towards the middle of the box of data from a distance:
1087-
eye = R + self.dist * ps
1087+
eye = R + self._dist * ps
10881088

10891089
# TODO: Is this being used somewhere? Can it be removed?
10901090
self.eye = eye
@@ -1098,7 +1098,7 @@ def get_proj(self):
10981098
V[self._vertical_axis] = -1 if abs(elev_rad) > 0.5 * np.pi else 1
10991099

11001100
viewM = proj3d.view_transformation(eye, R, V, roll_rad)
1101-
projM = self._projection(-self.dist, self.dist)
1101+
projM = self._projection(-self._dist, self._dist)
11021102
M0 = np.dot(viewM, worldM)
11031103
M = np.dot(projM, M0)
11041104
return M

0 commit comments

Comments
 (0)