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

Skip to content

Commit cc1b0c9

Browse files
committed
Merge pull request #5882 from zblz/edge-comma-dots
mathtext: Fix comma behaviour at start of string
2 parents d0186ac + a0c45ff commit cc1b0c9

17 files changed

+296
-228
lines changed

lib/matplotlib/mathtext.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2658,11 +2658,12 @@ def symbol(self, s, loc, toks):
26582658

26592659
# Do not space commas between brackets
26602660
if c == ',':
2661+
prev_char, next_char = '', ''
26612662
for i in six.moves.xrange(1, loc + 1):
26622663
prev_char = s[loc - i]
26632664
if prev_char != ' ':
26642665
break
2665-
for i in six.moves.xrange(1, loc + 1):
2666+
for i in six.moves.xrange(1, len(s) - loc):
26662667
next_char = s[loc + i]
26672668
if next_char != ' ':
26682669
break
Binary file not shown.

lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_cm_80.svg

Lines changed: 64 additions & 49 deletions
Loading
Binary file not shown.

lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_dejavusans_80.svg

Lines changed: 52 additions & 42 deletions
Loading
Binary file not shown.

0 commit comments

Comments
 (0)