From 77fa2859c06520f3cd4925f3ad23e17c34e14b9d Mon Sep 17 00:00:00 2001 From: MeeseeksMachine <39504233+meeseeksmachine@users.noreply.github.com> Date: Sat, 20 Oct 2018 13:32:16 -0700 Subject: [PATCH] Backport PR #12573: BUG: mplot3d: Don't crash if azim or elev are non-integral (#12575) --- lib/mpl_toolkits/mplot3d/axes3d.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py index 45bbb001fc8b..f6ae8a8ff6ce 100644 --- a/lib/mpl_toolkits/mplot3d/axes3d.py +++ b/lib/mpl_toolkits/mplot3d/axes3d.py @@ -1168,7 +1168,8 @@ def format_coord(self, xd, yd): return '' if self.button_pressed in self._rotate_btn: - return 'azimuth=%d deg, elevation=%d deg ' % (self.azim, self.elev) + return 'azimuth={:.0f} deg, elevation={:.0f} deg '.format( + self.azim, self.elev) # ignore xd and yd and display angles instead # nearest edge