-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Trying to set the labels without setting ticks through pyplot now raises TypeError* #15927
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
Trying to set the labels without setting ticks through pyplot now raises TypeError* #15927
Conversation
d963707
to
274fbdc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commits should be squashed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should get an entry in doc/api/next_api_changes/behavior.rst
.
274fbdc
to
a9ebd40
Compare
Sorry for the flask8 compliance issue, thought it was OK with 80 but should've tested -- still have a lot to learn. Should be good now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! From my side, this is good to go. Waiting for a second positive review.
Commits should still be squashed. Can be done by the author locally + force-push; or if you're not that familiar with git, we'll squash through the github interface when merging.
…ses TypeError with a proper message
a9ebd40
to
86dd139
Compare
Thanks for the PR, hoping to see you around again :) |
PR Summary
This PR was suggested in issue #15005 as to fix the error that is returned when xticks() or yticks() is called with only the labels as parameters. It is also a follow up from PR #15788.
Previously, passing labels without passing the ticks to either
pyplot.xticks()
andpyplot.yticks()
would result inTypeError: object of type 'NoneType' has no len()
. With this PR it now returns:AttributeError: Labels can't be set without setting ticks
.PS: apologies for the delay.
PR Checklist