Skip to content

Commit 230f0fb

Browse files
committed
output type stick to python float
1 parent cee60e7 commit 230f0fb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/matplotlib/tests/test_text.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import matplotlib.transforms as mtransforms
1414
from matplotlib.testing.decorators import check_figures_equal, image_comparison
1515

16+
1617
needs_usetex = pytest.mark.skipif(
1718
not mpl.checkdep_usetex(True),
1819
reason="This test needs a TeX installation")
@@ -696,5 +697,5 @@ def test_transform_rotates_text():
696697
transform = mtransforms.Affine2D().rotate_deg(30)
697698
text = ax.text(0, 0, 'test', transform=transform,
698699
transform_rotates_text=True)
699-
result = text.get_rotation()[0]
700+
result = text.get_rotation()
700701
assert_almost_equal(result, 30)

lib/matplotlib/text.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ def get_rotation(self):
233233
if self.get_transform_rotates_text():
234234
angle = get_rotation(self._rotation)
235235
x, y = self.get_unitless_position()
236-
return self.get_transform().transform_angles([angle, ], [[x, y]])
236+
trans = self.get_transform()
237+
return trans.transform_angles([angle], [[x, y]]).item(0)
237238
else:
238239
return get_rotation(self._rotation) # string_or_number -> number
239240

0 commit comments

Comments
 (0)