Skip to content

Commit 425eade

Browse files
Fix plot flipping at elev>270
1 parent e1770bc commit 425eade

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,9 +1059,9 @@ def get_proj(self):
10591059
# elev stores the elevation angle in the z plane
10601060
# azim stores the azimuth angle in the x,y plane
10611061
# roll stores the roll angle about the view axis
1062-
elev_rad = np.deg2rad(self.elev)
1063-
azim_rad = np.deg2rad(self.azim)
1064-
roll_rad = np.deg2rad(self.roll)
1062+
elev_rad = np.deg2rad(art3d._norm_angle(self.elev))
1063+
azim_rad = np.deg2rad(art3d._norm_angle(self.azim))
1064+
roll_rad = np.deg2rad(art3d._norm_angle(self.roll))
10651065

10661066
# Coordinates for a point that rotates around the box of data.
10671067
# p0, p1 corresponds to rotating the box only around the
@@ -1272,8 +1272,8 @@ def _on_move(self, event):
12721272
return
12731273
delev = +(dy/h)*180*np.cos(roll) + (dx/w)*180*np.sin(roll)
12741274
dazim = -(dy/h)*180*np.sin(roll) + (dx/w)*180*np.cos(roll)
1275-
self.elev = art3d._norm_angle(self.elev - delev)
1276-
self.azim = art3d._norm_angle(self.azim - dazim)
1275+
self.elev = self.elev - delev
1276+
self.azim = self.azim - dazim
12771277
self.get_proj()
12781278
self.stale = True
12791279
self.figure.canvas.draw_idle()

0 commit comments

Comments
 (0)