Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

mathtext: Fix comma behaviour at start of string #5882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 25, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix string edge behaviour for comma and dot
  • Loading branch information
zblz committed Jan 19, 2016
commit 358cdeeb35d21b6e7e1c328e258951aee1e332bd
3 changes: 2 additions & 1 deletion 3 lib/matplotlib/mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -2658,11 +2658,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
2 changes: 1 addition & 1 deletion 2 lib/matplotlib/tests/test_mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
' '.join('$\\' + p + '$' for p in sorted(mathtext.Parser._snowflake)),
r'$6-2$; $-2$; $ -2$; ${-2}$; ${ -2}$; $20^{+3}_{-2}$',
r'$\overline{\omega}^x \frac{1}{2}_0^x$', # github issue #5444
r'$1{,}234{, }567{ , }890$ and $1,234,567,890$', # github issue 5799
r'$,$ $.$ $1{,}234{, }567{ , }890$ and $1,234,567,890$', # github issue 5799
]

digits = "0123456789"
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.