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

Skip to content

Commit e513cab

Browse files
authored
Merge pull request #28186 from OdileVidrine/unary-minus-spacing
apply unary minus spacing directly after equals sign
2 parents 479bd7a + 78a813c commit e513cab

17 files changed

+805
-3
lines changed

lib/matplotlib/_mathtext.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,14 +2278,14 @@ def symbol(self, s: str, loc: int,
22782278

22792279
if c in self._spaced_symbols:
22802280
# iterate until we find previous character, needed for cases
2281-
# such as ${ -2}$, $ -2$, or $ -2$.
2281+
# such as $=-2$, ${ -2}$, $ -2$, or $ -2$.
22822282
prev_char = next((c for c in s[:loc][::-1] if c != ' '), '')
22832283
# Binary operators at start of string should not be spaced
22842284
# Also, operators in sub- or superscripts should not be spaced
22852285
if (self._in_subscript_or_superscript or (
22862286
c in self._binary_operators and (
2287-
len(s[:loc].split()) == 0 or prev_char == '{' or
2288-
prev_char in self._left_delims))):
2287+
len(s[:loc].split()) == 0 or prev_char in {
2288+
'{', *self._left_delims, *self._relation_symbols}))):
22892289
return [char]
22902290
else:
22912291
return [Hlist([self._make_space(0.2),
Binary file not shown.
Lines changed: 199 additions & 0 deletions
Loading
Binary file not shown.
Lines changed: 159 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)