-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Unclear error message for plt.xticks(names)
#12990
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
Comments
For anyone who wants to work on this, note that it is legal to pass strings as positions to xticks(), in case the axis is categorical (e.g. |
@anntzer is the categorial stuff explicitly supported for |
I think categorical support should be assumed unless a function explicitly says it doesn't support categoricals (for example neither plot() nor bar() mention they support categoricals either). In the example you give, this is "expected": the categories "a" and "b" don't exist yet, so they get created at x = 2 and x = 3, to the right of "foo" and "bar". |
Uh oh!
There was an error while loading. Please reload this page.
I suggest to improve the error message when an argument of
xticks
is missing. This would considerably ease debugging.Here the problem is that I forgot the
xs
argument forplt.xticks
:The error message should state so, but here's what it currently prints:
And the traceback:
The text was updated successfully, but these errors were encountered: