8000 Merge pull request #7520 from dstansby/table-bug · matplotlib/matplotlib@c260365 · GitHub
[go: up one dir, main page]

Skip to content

Commit c260365

Browse files
authored
Merge pull request #7520 from dstansby/table-bug
Fix table.py bug
2 parents 6a56f69 + 4d412fd commit c260365

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/matplotlib/table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ def table(ax,
586586
# assume just colours are needed
587587
rows = len(cellColours)
588588
cols = len(cellColours[0])
589-
cellText = [[''] * rows] * cols
589+
cellText = [[''] * cols] * rows
590590

591591
rows = len(cellText)
592592
cols = len(cellText[0])

lib/matplotlib/tests/test_table.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@
55

66
import matplotlib.pyplot as plt
77
import numpy as np
8-
from matplotlib.testing.decorators import image_comparison
8+
from matplotlib.testing.decorators import image_comparison, cleanup
99

1010
from matplotlib.table import CustomCell
1111
from matplotlib.path import Path
1212
from nose.tools import assert_equal
1313

1414

15+
@cleanup
16+
def test_non_square():
17+
# Check that creating a non-square table works
18+
cellcolors = ['b', 'r']
19+
plt.table(cellColours=cellcolors)
20+
21+
1522
@image_comparison(baseline_images=['table_zorder'],
1623
extensions=['png'],
1724
remove_text=True)

0 commit comments

Comments
 (0)
0