Skip to content

Commit db81ab2

Browse files
committed
Fix position of rotated text in Agg backend
1 parent 89479d3 commit db81ab2

File tree

3 files changed

+1
-1
lines changed

3 files changed

+1
-1
lines changed

lib/matplotlib/backends/backend_agg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
180180
font.draw_glyphs_to_bitmap(antialiased=rcParams['text.antialiased'])
181181
d = font.get_descent() / 64.0
182182
# The descent needs to be adjusted for the angle
183-
xd = d * np.sin(np.deg2rad(angle))
183+
xd = -d * np.sin(np.deg2rad(angle))
184184
yd = d * np.cos(np.deg2rad(angle))
185185

186186
#print x, y, int(x), int(y), s
116 Bytes
Loading
-5 Bytes
Loading

0 commit comments

Comments
 (0)