@@ -54,7 +54,7 @@ class Axes3D(Axes):
54
54
55
55
def __init__ (
56
56
self , fig , rect = None , * args ,
57
- elev = 30 , azim = - 60 , tilt = 0 , sharez = None , proj_type = 'persp' ,
57
+ elev = 30 , azim = - 60 , roll = 0 , sharez = None , proj_type = 'persp' ,
58
58
box_aspect = None , computed_zorder = True ,
59
59
** kwargs ):
60
60
"""
@@ -68,8 +68,8 @@ def __init__(
68
68
Elevation viewing angle.
69
69
azim : float, default: -60
70
70
Azimuthal viewing angle.
71
- tilt : float, default: 0
72
- Tilt viewing angle.
71
+ roll : float, default: 0
72
+ Roll viewing angle.
73
73
sharez : Axes3D, optional
74
74
Other axes to share z-limits with.
75
75
proj_type : {'persp', 'ortho'}
@@ -103,7 +103,7 @@ def __init__(
103
103
104
104
self .initial_azim = azim
105
105
self .initial_elev = elev
106
- self .initial_tilt = tilt
106
+ self .initial_roll = roll
107
107
self .set_proj_type (proj_type )
108
108
self .computed_zorder = computed_zorder
109
109
@@ -115,7 +115,7 @@ def __init__(
115
115
116
116
# inhibit autoscale_view until the axes are defined
117
117
# they can't be defined until Axes.__init__ has been called
118
- self .view_init (self .initial_elev , self .initial_azim , self .initial_tilt )
118
+ self .view_init (self .initial_elev , self .initial_azim , self .initial_roll )
119
119
120
120
self ._sharez = sharez
121
121
if sharez is not None :
@@ -979,7 +979,7 @@ def clabel(self, *args, **kwargs):
979
979
"""Currently not implemented for 3D axes, and returns *None*."""
980
980
return None
981
981
982
- def view_init (self , elev = None , azim = None , tilt = None , vertical_axis = "z" ):
982
+ def view_init (self , elev = None , azim = None , roll = None , vertical_axis = "z" ):
983
983
"""
984
984
Set the elevation and azimuth of the axes in degrees (not radians).
985
985
@@ -995,8 +995,8 @@ def view_init(self, elev=None, azim=None, tilt=None, vertical_axis="z"):
995
995
The azimuth angle in the horizontal plane in degrees.
996
996
If None then the initial value as specified in the `Axes3D`
997
997
constructor is used.
998
- tilt : float, default: None
999
- The tilt angle about the viewing direction in degrees.
998
+ roll : float, default: None
999
+ The roll angle about the viewing direction in degrees.
1000
1000
If None then the initial value as specified in the `Axes3D`
1001
1001
constructor is used.
1002
1002
vertical_axis : {"z", "x", "y"}, default: "z"
@@ -1015,10 +1015,10 @@ def view_init(self, elev=None, azim=None, tilt=None, vertical_axis="z"):
1015
1015
else :
1016
1016
self .azim = azim
1017
1017
1018
- if tilt is None :
1019
- self .tilt = self .initial_tilt
1018
+ if roll is None :
1019
+ self .roll = self .initial_roll
1020
1020
else :
1021
- self .tilt = tilt
1021
+ self .roll = roll
1022
1022
1023
1023
self ._vertical_axis = _api .check_getitem (
1024
1024
dict (x = 0 , y = 1 , z = 2 ), vertical_axis = vertical_axis
@@ -1058,10 +1058,10 @@ def get_proj(self):
1058
1058
1059
1059
# elev stores the elevation angle in the z plane
1060
1060
# azim stores the azimuth angle in the x,y plane
1061
- # tilt stores the tilt angle about the view axis
1061
+ # roll stores the roll angle about the view axis
1062
1062
elev_rad = np .deg2rad (art3d ._norm_angle (self .elev ))
1063
1063
azim_rad = np .deg2rad (art3d ._norm_angle (self .azim ))
1064
- tilt_rad = np .deg2rad (art3d ._norm_angle (self .tilt ))
1064
+ roll_rad = np .deg2rad (art3d ._norm_angle (self .roll ))
1065
1065
1066
1066
# Coordinates for a point that rotates around the box of data.
1067
1067
# p0, p1 corresponds to rotating the box only around the
@@ -1091,7 +1091,7 @@ def get_proj(self):
1091
1091
V = np .zeros (3 )
1092
1092
V [self ._vertical_axis ] = - 1 if abs (elev_rad ) > 0.5 * np .pi else 1
1093
1093
1094
- viewM = proj3d .view_transformation (eye , R , V , tilt_rad )
1094
+ viewM = proj3d .view_transformation (eye , R , V , roll_rad )
1095
1095
projM = self ._projection (- self .dist , self .dist )
1096
1096
M0 = np .dot (viewM , worldM )
1097
1097
M = np .dot (projM , M0 )
@@ -1179,15 +1179,15 @@ def _button_release(self, event):
1179
1179
def _get_view (self ):
1180
1180
# docstring inherited
1181
1181
return (self .get_xlim (), self .get_ylim (), self .get_zlim (),
1182
- self .elev , self .azim , self .tilt )
1182
+ self .elev , self .azim , self .roll )
1183
1183
1184
1184
def _set_view (self , view ):
1185
1185
# docstring inherited
1186
- xlim , ylim , zlim , elev , azim , tilt = view
1186
+ xlim , ylim , zlim , elev , azim , roll = view
1187
1187
self .set (xlim = xlim , ylim = ylim , zlim = zlim )
1188
1188
self .elev = elev
1189
1189
self .azim = azim
1190
- self .tilt = tilt
1190
+ self .roll = roll
1191
1191
1192
1192
def format_zdata (self , z ):
1193
1193
"""
@@ -1216,10 +1216,10 @@ def format_coord(self, xd, yd):
1216
1216
# ignore xd and yd and display angles instead
1217
1217
norm_elev = art3d ._norm_angle (self .elev )
1218
1218
norm_azim = art3d ._norm_angle (self .azim )
1219
- norm_tilt = art3d ._norm_angle (self .tilt )
1219
+ norm_roll = art3d ._norm_angle (self .roll )
1220
1220
return (f"elevation={ norm_elev :.0f} \N{DEGREE SIGN} , "
1221
1221
f"azimuth={ norm_azim :.0f} \N{DEGREE SIGN} , "
1222
- f"tilt= { norm_tilt :.0f} \N{DEGREE SIGN} "
1222
+ f"roll= { norm_roll :.0f} \N{DEGREE SIGN} "
1223
1223
).replace ("-" , "\N{MINUS SIGN} " )
1224
1224
1225
1225
# nearest edge
@@ -1273,9 +1273,9 @@ def _on_move(self, event):
1273
1273
if dx == 0 and dy == 0 :
1274
1274
return
1275
1275
1276
- tilt = np .deg2rad (self .tilt )
1277
- delev = - (dy / h )* 180 * np .cos (tilt ) - (dx / w )* 180 * np .sin (tilt )
1278
- dazim = + (dy / h )* 180 * np .sin (tilt ) - (dx / w )* 180 * np .cos (tilt )
1276
+ roll = np .deg2rad (self .roll )
1277
+ delev = - (dy / h )* 180 * np .cos (roll ) + (dx / w )* 180 * np .sin (roll )
1278
+ dazim = - (dy / h )* 180 * np .sin (roll ) - (dx / w )* 180 * np .cos (roll )
1279
1279
self .elev = self .elev + delev
1280
1280
self .azim = self .azim + dazim
1281
1281
self .get_proj ()
@@ -3273,10 +3273,10 @@ def _extract_errs(err, data, lomask, himask):
3273
3273
quiversize = np .mean (np .diff (quiversize , axis = 0 ))
3274
3274
# quiversize is now in Axes coordinates, and to convert back to data
3275
3275
# coordinates, we need to run it through the inverse 3D transform. For
3276
- # consistency, this uses a fixed elevation, azimuth, and tilt .
3277
- with cbook ._setattr_cm (self , elev = 0 , azim = 0 , tilt = 0 ):
3276
+ # consistency, this uses a fixed elevation, azimuth, and roll .
3277
+ with cbook ._setattr_cm (self , elev = 0 , azim = 0 , roll = 0 ):
3278
3278
invM = np .linalg .inv (self .get_proj ())
3279
- # elev=azim=tilt =0 produces the Y-Z plane, so quiversize in 2D 'x' is
3279
+ # elev=azim=roll =0 produces the Y-Z plane, so quiversize in 2D 'x' is
3280
3280
# 'y' in 3D, hence the 1 index.
3281
3281
quiversize = np .dot (invM , np .array ([quiversize , 0 , 0 , 0 ]))[1 ]
3282
3282
# Quivers use a fixed 15-degree arrow head, so scale up the length so
0 commit comments