8000 Merge pull request #5882 from zblz/edge-comma-dots · matplotlib/matplotlib@b04c5b9 · GitHub
[go: up one dir, main page]

Skip to content

Commit b04c5b9

Browse files
mdboomQuLogic
authored andcommitted
Merge pull request #5882 from zblz/edge-comma-dots
mathtext: Fix comma behaviour at start of string
1 parent f9cb9cf commit b04c5b9

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
@@ -2656,11 +2656,12 @@ def symbol(self, s, loc, toks):
26562656

26572657
# Do not space commas between brackets
26582658
if c == ',':
2659+
prev_char, next_char = '', ''
26592660
for i in six.moves.xrange(1, loc + 1):
26602661
prev_char = s[loc - i]
26612662
if prev_char != ' ':
26622663
break
2663-
for i in six.moves.xrange(1, loc + 1):
2664+
for i in six.moves.xrange(1, len(s) - loc):
26642665
next_char = s[loc + i]
26652666
if next_char != ' ':
26662667
break
Binary file not shown.
Loading

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

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

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

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

0 commit comments

Comments
 (0)
0