8000 Merge pull request #23209 from tfpf/overunder-valign · matplotlib/matplotlib@f278686 · GitHub
[go: up one dir, main page]

Skip to content

Commit f278686

Browse files
authored
Merge pull request #23209 from tfpf/overunder-valign
Fix the vertical alignment of overunder symbols.
2 parents 0ebff50 + d914660 commit f278686

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
@@ -2200,9 +2200,9 @@ def subsuper(self, s, loc, toks):
22002200
hlist = HCentered([sub])
22012201
hlist.hpack(width, 'exactly')
22022202
vlist.extend([Vbox(0, vgap), hlist])
2203-
shift = hlist.height + vgap
2203+
shift = hlist.height + vgap + nucleus.depth
22042204
vlist = Vlist(vlist)
2205-
vlist.shift_amount = shift + nucleus.depth
2205+
vlist.shift_amount = shift
22062206
result = Hlist([vlist])
22072207
return [result]
22082208

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