Skip to content

Commit e100d14

Browse files
Normalize the displayed angles for 3d plots when rotating with mouse
1 parent a851eff commit e100d14

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,9 +1214,9 @@ def format_coord(self, xd, yd):
12141214

12151215
if self.button_pressed in self._rotate_btn:
12161216
# ignore xd and yd and display angles instead
1217-
return (f"azimuth={self.azim:.0f}\N{DEGREE SIGN}, "
1218-
f"elevation={self.elev:.0f}\N{DEGREE SIGN}, "
1219-
f"roll={self.roll:.0f}\N{DEGREE SIGN}"
1217+
return (f"azimuth={art3d._norm_angle(self.azim):.0f}\N{DEGREE SIGN}, "
1218+
f"elevation={art3d._norm_angle(self.elev):.0f}\N{DEGREE SIGN}, "
1219+
f"roll={art3d._norm_angle(self.roll):.0f}\N{DEGREE SIGN}"
12201220
).replace("-", "\N{MINUS SIGN}")
12211221

12221222
# nearest edge

0 commit comments

Comments
 (0)