Skip to content

Commit

Permalink
Merge pull request matplotlib#7520 from dstansby/table-bug
Browse files Browse the repository at this point in the history
Fix table.py bug
  • Loading branch information
NelleV committed Nov 27, 2016
1 parent 3972533 commit 5546552
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/matplotlib/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ def table(ax,
# assume just colours are needed
rows = len(cellColours)
cols = len(cellColours[0])
cellText = [[''] * rows] * cols
cellText = [[''] * cols] * rows

rows = len(cellText)
cols = len(cellText[0])
Expand Down
9 changes: 8 additions & 1 deletion lib/matplotlib/tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@

import matplotlib.pyplot as plt
import numpy as np
from matplotlib.testing.decorators import image_comparison
from matplotlib.testing.decorators import image_comparison, cleanup

from matplotlib.table import CustomCell
from matplotlib.path import Path
from nose.tools import assert_equal


@cleanup
def test_non_square():
# Check that creating a non-square table works
cellcolors = ['b', 'r']
plt.table(cellColours=cellcolors)


@image_comparison(baseline_images=['table_zorder'],
extensions=['png'],
remove_text=True)
Expand Down

0 comments on commit 5546552

Please sign in to comment.