Skip to content
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

ENH : improve error invalid error message for subplot #2780

Merged
merged 1 commit into from Feb 2, 2014

Conversation

tacaswell
Copy link
Member

Closes #2098

If user passes in a not-three-digit integer, raise ValueError
instead of letting the error propagate up from much farther down
the stack

@@ -901,6 +901,10 @@ def add_subplot(self, *args, **kwargs):

if len(args) == 1 and isinstance(args[0], int):
args = tuple([int(c) for c in str(args[0])])
if len(args) != 3:
raise ValueError("Integer subplot specification must " +
"be a three digit number. " +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the travis failure is pep8 complaining about the extra space--horrors!--before the plus sign.

@tacaswell
Copy link
Member Author

sigh.

On this computer the pep8 tool grows confused by the collections.py in the matplotlib directory so the in editor highlighting fails.

Fixed and forced.

Closes matplotlib#2098

If user passes in a not-three-digit integer, raise `ValueError`
instead of letting the error propagate up from much farther down
the stack
@tacaswell
Copy link
Member Author

travis is happy except for 3.2 which has it's own issues.

efiring added a commit that referenced this pull request Feb 2, 2014
ENH : improve error invalid error message for subplot
@efiring efiring merged commit 8115e68 into matplotlib:master Feb 2, 2014
@tacaswell tacaswell deleted the subplot_errormsg branch February 2, 2014 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

figure.add_subplot(1311): ValueError: Illegal argument(s) to subplot: (1, 3, 1, 1)
2 participants