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

Commit 25590c8

Browse filesBrowse files
committed
Merge pull request #5813 from zblz/dec-comma
mathtext: no space after comma in brackets
2 parents acbbfff + 91fcc61 commit 25590c8
Copy full SHA for 25590c8
Expand file treeCollapse file tree

17 files changed

+2064
-0
lines changed

‎lib/matplotlib/mathtext.py

Copy file name to clipboardExpand all lines: lib/matplotlib/mathtext.py
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2646,6 +2646,20 @@ def symbol(self, s, loc, toks):
26462646
self._make_space(0.2)] ,
26472647
do_kern = True)]
26482648
elif c in self._punctuation_symbols:
2649+
2650+
# Do not space commas between brackets
2651+
if c == ',':
2652+
for i in six.moves.xrange(1, loc + 1):
2653+
prev_char = s[loc - i]
2654+
if prev_char != ' ':
2655+
break
2656+
for i in six.moves.xrange(1, loc + 1):
2657+
next_char = s[loc + i]
2658+
if next_char != ' ':
2659+
break
2660+
if (prev_char == '{' and next_char == '}'):
2661+
return [char]
2662+
26492663
# Do not space dots as decimal separators
26502664
if (c == '.' and s[loc - 1].isdigit() and s[loc + 1].isdigit()):
26512665
return [char]
@@ -2819,6 +2833,9 @@ def is_slanted(self, nucleus):
28192833
return nucleus.is_slanted()
28202834
return False
28212835

2836+
def is_between_brackets(self, s, loc):
2837+
return False
2838+
28222839
def subsuper(self, s, loc, toks):
28232840
assert(len(toks)==1)
28242841

Binary file not shown.
Loading

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.