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 40bbe61

Browse filesBrowse files
committed
Merge remote-tracking branch 'matplotlib/v1.5.x' into v2.x
2 parents 8e57552 + cab8cf7 commit 40bbe61
Copy full SHA for 40bbe61

File tree

Expand file treeCollapse file tree

2 files changed

+6
-7
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-7
lines changed

‎lib/matplotlib/mlab.py

Copy file name to clipboardExpand all lines: lib/matplotlib/mlab.py
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3188,9 +3188,8 @@ def get_justify(colname, column, precision):
31883188
ntype = column.dtype
31893189

31903190
if np.issubdtype(ntype, str) or np.issubdtype(ntype, bytes):
3191-
# The division below handles unicode stored in array, which could
3192-
# have 4 bytes per char
3193-
length = max(len(colname), column.itemsize // column[0].itemsize)
3191+
fixed_width = int(ntype.str[2:])
3192+
length = max(len(colname), fixed_width)
31943193
return 0, length+padding, "%s" # left justify
31953194

31963195
if np.issubdtype(ntype, np.int):

‎lib/matplotlib/tests/test_mlab.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_mlab.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,10 @@ def test_csv2txt_basic(self):
403403
(str('y'), np.int8),
404404
(str('s'), str, 3),
405405
(str('s2'), str, 4)]))
406-
truth = (' x y s s2\n'
407-
' 1.000 2 foo bing \n'
408-
' 2.000 3 bar blah ')
409-
assert_equal(mlab.rec2txt(a), truth)
406+
truth = (' x y s s2\n'
407+
' 1.000 2 foo bing \n'
408+
' 2.000 3 bar blah ').splitlines()
409+
assert_equal(mlab.rec2txt(a).splitlines(), truth)
410410

411411

412412
class window_testcase(CleanupTestCase):

0 commit comments

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