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

Skip to content

Commit a8cb00d

Browse files
committed
Use np.deg2rad instead
1 parent f4b57da commit a8cb00d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/backends/backend_agg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
181181
font.draw_glyphs_to_bitmap(antialiased=rcParams['text.antialiased'])
182182
d = font.get_descent() / 64.0
183183
# The descent needs to be adjusted for the angle
184-
xd = d * np.sin(angle / (180.0 * np.pi))
185-
yd = d * np.cos(angle / (180.0 * np.pi))
184+
xd = d * np.sin(np.deg2rad(angle))
185+
yd = d * np.cos(np.deg2rad(angle))
186186

187187
#print x, y, int(x), int(y), s
188188
self._renderer.draw_text_image(

0 commit comments

Comments
 (0)