8000 Check at least one argument is provided for plt.table by dstansby · Pull Request #7522 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Check at least one argument is provided for plt.table #7522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Load 8000 ing
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5873,10 +5873,10 @@ def table(self, **kwargs):
colLabels=None, colColours=None, colLoc='center',
loc='bottom', bbox=None):

Returns a :class:`matplotlib.table.Table` instance. For finer
grained control over tables, use the
:class:`~matplotlib.table.Table` class and add it to the axes
with :meth:`~matplotlib.axes.Axes.add_table`.
Returns a :class:`matplotlib.table.Table` instance. Either `cellText`
or `cellColours` must be provided. For finer grained control over
tables, use the :class:`~matplotlib.table.Table` class and add it to
the axes with :meth:`~matplotlib.axes.Axes.add_table`.

Thanks to John Gill for providing the class and table.

Expand Down
4 changes: 4 additions & 0 deletions lib/matplotlib/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,10 @@ def table(ax,
Thanks to John Gill for providing the class and table.
"""

if cellColours is None and cellText is None:
raise ValueError('At least one argument from "cellColours" or '
'"cellText" must be provided to create a table.')

# Check we have some cellText
if cellText is None:
# assume just colours are needed
Expand Down
0