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

Skip to content

BUG: Dot should not be spaced when used as a decimal separator #5301

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 1 commit into from
Oct 29, 2015
Merged
Changes from all commits
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
19 changes: 12 additions & 7 deletions lib/matplotlib/mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -2504,17 +2504,22 @@ def symbol(self, s, loc, toks):
break
# Binary operators at start of string should not be spaced
if (c in self._binary_operators and
(len(s[:loc].split()) == 0 or prev_char == '{')):
(len(s[:loc].split()) == 0 or prev_char == '{' or
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should support everything in _left_delim. Could probably just be prev_char in self._left_delim.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, _left_delim is definitely more general than (. However, { is not in _left_delim (only \{), so I'll do that comparison separately.

prev_char in self._left_delim)):
return [char]
else:
return [Hlist( [self._make_space(0.2),
char,
self._make_space(0.2)] ,
return [Hlist([self._make_space(0.2),
char,
self._make_space(0.2)] ,
do_kern = True)]
elif c in self._punctuation_symbols:
return [Hlist( [char,
self._make_space(0.2)] ,
do_kern = True)]
# Do not space dots as decimal separators
if (c == '.' and s[loc - 1].isdigit() and s[loc + 1].isdigit()):
return [char]
else:
return [Hlist([char,
self._make_space(0.2)],
do_kern = True)]
return [char]

snowflake = symbol
Expand Down