8000 Backport PR #23209: Fix the vertical alignment of overunder symbols. · matplotlib/matplotlib@1fc9467 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1fc9467

Browse files
timhoffmmeeseeksmachine
authored andcommitted
Backport PR #23209: Fix the vertical alignment of overunder symbols.
1 parent e163a0b commit 1fc9467

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

lib/matplotlib/_mathtext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2660,9 +2660,9 @@ def subsuper(self, s, loc, toks):
26602660
hlist = HCentered([sub])
26612661
hlist.hpack(width, 'exactly')
26622662
vlist.extend([Vbox(0, vgap), hlist])
2663-
shift = hlist.height + vgap
2663+
shift = hlist.height + vgap + nucleus.depth
26642664
vlist = Vlist(vlist)
2665-
vlist.shift_amount = shift + nucleus.depth
2665+
vlist.shift_amount = shift
26662666
result = Hlist([vlist])
26672667
return [result]
26682668

Loading

lib/matplotlib/tests/test_mathtext.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
lightweight_math_tests = [
123123
r'$\sqrt[ab]{123}$', # github issue #8665
124124
r'$x \overset{f}{\rightarrow} \overset{f}{x} \underset{xx}{ff} \overset{xx}{ff} \underset{f}{x} \underset{f}{\leftarrow} x$', # github issue #18241
125+
r'$\sum x\quad\sum^nx\quad\sum_nx\quad\sum_n^nx\quad\prod x\quad\prod^nx\quad\prod_nx\quad\prod_n^nx$', # GitHub issue 18085
125126
]
126127

127128
digits = "0123456789"

0 commit comments

Comments
 (0)
0