Skip to content

Commit 3120e6c

Browse files
committed
Merge pull request #1968 from mdboom/rotated_text
Rotated text element misalignment in Agg
2 parents 89479d3 + db81ab2 commit 3120e6c

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
Loading

0 commit comments

Comments
 (0)