Skip to content

plt.table() without any kwargs throws exception #7519

Closed

Description

@dstansby

Installed from source using pip on OSX.
Version 2.0.0b4+2948.g6a56f69

I encountered this when trying to fix #5350. Just using plt.table() errors, which I wouldn't expect given all the arguments are optional...

Minimal snippet:

import matplotlib.pyplot as plt
plt.table()

And output:

python test.py 
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    plt.table()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py", line 3484, in table
    ret = gca().table(**kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/axes/_axes.py", line 5884, in table
    return mtable.table(self, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/table.py", line 587, in table
    rows = len(cellColours)
TypeError: object of type 'NoneType' has no len()

Activity

  1. added this to the milestone on Nov 27, 2016
  2. tacaswell commented on Nov 27, 2016

    @tacaswell
    Member

    The exact work to do here is to:

    • add check and user-friendly exception to matplotlib.table.table to check if both cellColours and cellText are None
  3. modified the milestones: , on Dec 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Easyhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions