Skip to content

Commit

Permalink
Merge pull request #5882 from zblz/edge-comma-dots
Browse files Browse the repository at this point in the history
mathtext: Fix comma behaviour at start of string
  • Loading branch information
mdboom authored and QuLogic committed Oct 16, 2016
1 parent f9cb9cf commit b04c5b9
Show file tree
Hide file tree
Showing 17 changed files with 296 additions and 228 deletions.
3 changes: 2 additions & 1 deletion lib/matplotlib/mathtext.py
Expand Up @@ -2656,11 +2656,12 @@ def symbol(self, s, loc, toks):

# Do not space commas between brackets
if c == ',':
prev_char, next_char = '', ''
for i in six.moves.xrange(1, loc + 1):
prev_char = s[loc - i]
if prev_char != ' ':
break
for i in six.moves.xrange(1, loc + 1):
for i in six.moves.xrange(1, len(s) - loc):
next_char = s[loc + i]
if next_char != ' ':
break
Expand Down
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
113 changes: 64 additions & 49 deletions lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_cm_80.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b04c5b9

Please sign in to comment.