Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8007cd1

Browse files
committed
latest finetuning for cm, other fonts will need different parameters!
1 parent 800ff30 commit 8007cd1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/matplotlib/mathtext.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ def get_underline_thickness(self, font, fontsize, dpi):
11871187
# get any smaller
11881188
NUM_SIZE_LEVELS = 6
11891189
# Percentage of x-height of additional horiz. space after sub/superscripts
1190-
SCRIPT_SPACE = 0.07
1190+
SCRIPT_SPACE = 0.00
11911191
# Percentage of x-height that sub/superscripts drop below the baseline
11921192
SUBDROP = 0.3
11931193
# Percentage of x-height that superscripts drop below the baseline
@@ -2685,7 +2685,10 @@ def subsuper(self, s, loc, toks):
26852685
"Subscript/superscript sequence is too long. "
26862686
"Use braces { } to remove ambiguity.")
26872687

2688-
last_char = nucleus.children[-2] if isinstance(nucleus,Hlist) else nucleus
2688+
last_char = nucleus
2689+
if isinstance(nucleus,Hlist):
2690+
if len(nucleus.children) >= 2:
2691+
last_char = nucleus.children[-2]
26892692

26902693
state = self.get_state()
26912694
rule_thickness = state.font_output.get_underline_thickness(

0 commit comments

Comments
 (0)