Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 950d0db

Browse filesBrowse files
authored
Merge pull request #25784 from QuLogic/ps-usetex-anchor
ps: Fix anchoring of rotated usetex text
2 parents ccad5ef + b11ea41 commit 950d0db
Copy full SHA for 950d0db

File tree

Expand file treeCollapse file tree

6 files changed

+10850
-2
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+10850
-2
lines changed

‎lib/matplotlib/backends/backend_ps.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_ps.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,10 @@ def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
588588
s = fontcmd % s
589589
tex = r'\color[rgb]{%s} %s' % (color, s)
590590

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.