Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit60b60fb

Browse files
committed
Merge pull request#5301 from zblz/fix-dot-space
BUG: Dot should not be spaced when used as a decimal separator
1 parentcdea77c commit60b60fb

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

‎lib/matplotlib/mathtext.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,17 +2503,22 @@ def symbol(self, s, loc, toks):
25032503
break
25042504
# Binary operators at start of string should not be spaced
25052505
if (cinself._binary_operatorsand
2506-
(len(s[:loc].split())==0orprev_char=='{')):
2506+
(len(s[:loc].split())==0orprev_char=='{'or
2507+
prev_charinself._left_delim)):
25072508
return [char]
25082509
else:
2509-
return [Hlist([self._make_space(0.2),
2510-
char,
2511-
self._make_space(0.2)] ,
2510+
return [Hlist([self._make_space(0.2),
2511+
char,
2512+
self._make_space(0.2)] ,
25122513
do_kern=True)]
25132514
elifcinself._punctuation_symbols:
2514-
return [Hlist( [char,
2515-
self._make_space(0.2)] ,
2516-
do_kern=True)]
2515+
# Do not space dots as decimal separators
2516+
if (c=='.'ands[loc-1].isdigit()ands[loc+1].isdigit()):
2517+
return [char]
2518+
else:
2519+
return [Hlist([char,
2520+
self._make_space(0.2)],
2521+
do_kern=True)]
25172522
return [char]
25182523

25192524
snowflake=symbol

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp