@@ -1049,17 +1049,17 @@ def set_proj_type(self, proj_type, focal_length=None):
1049
1049
_api .check_in_list (['persp' , 'ortho' ], proj_type = proj_type )
1050
1050
if proj_type == 'persp' :
1051
1051
if focal_length is None :
1052
- self .focal_length = 1
1052
+ self ._focal_length = 1
1053
1053
else :
1054
1054
if focal_length <= 0 :
1055
1055
raise ValueError (f"focal_length = { focal_length } must be"
1056
1056
" greater than 0" )
1057
- self .focal_length = focal_length
1057
+ self ._focal_length = focal_length
1058
1058
elif proj_type == 'ortho' :
1059
1059
if focal_length not in (None , np .inf ):
1060
1060
raise ValueError (f"focal_length = { focal_length } must be"
1061
1061
f"None for proj_type = { proj_type } " )
1062
- self .focal_length = np .inf
1062
+ self ._focal_length = np .inf
1063
1063
1064
1064
def _roll_to_vertical (self , arr ):
1065
1065
"""Roll arrays to match the different vertical axis."""
@@ -1116,18 +1116,18 @@ def get_proj(self):
1116
1116
V [self ._vertical_axis ] = - 1 if abs (elev_rad ) > 0.5 * np .pi else 1
1117
1117
1118
1118
# Generate the view and projection transformation matrices
1119
- if self .focal_length == np .inf :
1119
+ if self ._focal_length == np .inf :
1120
1120
# Orthographic projection
1121
1121
viewM = proj3d .view_transformation (eye , R , V , roll_rad )
1122
1122
projM = proj3d .ortho_transformation (- self .dist , self .dist )
1123
1123
else :
1124
1124
# Perspective projection
1125
1125
# Scale the eye dist to compensate for the focal length zoom effect
1126
- eye_focal = R + self .dist * ps * self .focal_length
1126
+ eye_focal = R + self .dist * ps * self ._focal_length
1127
1127
viewM = proj3d .view_transformation (eye_focal , R , V , roll_rad )
1128
1128
projM = proj3d .persp_transformation (- self .dist ,
1129
1129
self .dist ,
1130
- self .focal_length )
1130
+ self ._focal_length )
1131
1131
1132
1132
# Combine all the transformation matrices to get the final projection
1133
1133
M0 = np .dot (viewM , worldM )
@@ -1192,7 +1192,7 @@ def cla(self):
1192
1192
pass
1193
1193
1194
1194
self ._autoscaleZon = True
1195
- if self .focal_length == np .inf :
1195
+ if self ._focal_length == np .inf :
1196
1196
self ._zmargin = rcParams ['axes.zmargin' ]
1197
1197
else :
1198
1198
self ._zmargin = 0.
0 commit comments