Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/matplotlib/backends/backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,10 @@ def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
s = fontcmd % s
tex = r'\color[rgb]{%s} %s' % (color, s)

# Stick to the bottom alignment.
pos = _nums_to_str(x, y-bl)
# Stick to bottom-left alignment, so subtract descent from the text-normal
# direction since text is normally positioned by its baseline.
rangle = np.radians(angle + 90)
pos = _nums_to_str(x - bl * np.cos(rangle), y - bl * np.sin(rangle))
self.psfrag.append(
r'\psfrag{%s}[bl][bl][1][%f]{\fontsize{%f}{%f}%s}' % (
thetext, angle, fontsize, fontsize*1.25, tex))
Expand Down
Loading