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

Skip to content

Commit 2322e05

Browse files
committed
Mathtext spaces must be independent of font style.
1 parent f3593ae commit 2322e05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/_mathtext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,13 +1935,13 @@ def non_math(self, s, loc, toks):
19351935
float_literal = staticmethod(pyparsing_common.convertToFloat)
19361936

19371937
def _make_space(self, percentage):
1938-
# All spaces are relative to em width
1938+
# All spaces are relative to em width of the italic font style.
19391939
state = self.get_state()
19401940
key = (state.font, state.fontsize, state.dpi)
19411941
width = self._em_width_cache.get(key)
19421942
if width is None:
19431943
metrics = state.font_output.get_metrics(
1944-
state.font, mpl.rcParams['mathtext.default'], 'm',
1944+
'it', mpl.rcParams['mathtext.default'], 'm',
19451945
state.fontsize, state.dpi)
19461946
width = metrics.advance
19471947
self._em_width_cache[key] = width

0 commit comments

Comments
 (0)