Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d21aa8f

Browse files
committed
BUG: Fix crash when view angles are floats
1 parent e18d5bf commit d21aa8f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,8 +1156,8 @@ def format_coord(self, xd, yd):
11561156
return ''
11571157

11581158
if self.button_pressed in self._rotate_btn:
1159-
return 'azimuth=%d deg, elevation=%d deg ' % (self.azim, self.elev)
1160-
# ignore xd and yd and display angles instead
1159+
return 'azimuth={:.0f} deg, elevation={:.0f} deg '.format(
1160+
self.azim, self.elev)
11611161

11621162
# nearest edge
11631163
p0, p1 = min(self.tunit_edges(),
@@ -1177,7 +1177,7 @@ def format_coord(self, xd, yd):
11771177
xs = self.format_xdata(x)
11781178
ys = self.format_ydata(y)
11791179
zs = self.format_zdata(z)
1180-
return 'x=%s, y=%s, z=%s' % (xs, ys, zs)
1180+
return 'x={}, y={}, z={}'.format(xs, ys, zs)
11811181

11821182
def _on_move(self, event):
11831183
"""Mouse moving

0 commit comments

Comments
 (0)