-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Clarify AxLine Params #27534
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
Clarify AxLine Params #27534
Conversation
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.
I can't flag the type error cause it's not in this PR, but I get the feeling it's gonna complicate things here b/c it implies you only need to pass one.
9c6faec
to
2d2e863
Compare
I'm sorry I'm not quite following this |
The error message that checks the parameters says that exactly one must be given. I think given is ambiguous enough in this context that one valid reading is that only one parameter must be passed in. matplotlib/lib/matplotlib/lines.py Lines 1474 to 1477 in dce9ea4
|
…534-on-v3.8.x Backport PR #27534 on branch v3.8.x (Clarify AxLine Params)
@story645 thanks I’m with you now (my head was stuck in mypy type errors). The majority of users who see that error will be using |
I might be missing a beat, why can't both parameters be defaulted to none in the init? |
I came here to say the same as @story645. (With that said, I may also be missing something here...) However, not sure that such a change should be backported? And an API-change note is required. (Also, one may consider documenting that |
Fully agree that requiring xy2 and slope is not a good API. Ideally, we would have introduced a class method I'm fine with introducing None-defaults. |
PR summary
Closes #27503 following #27503 (comment).
PR checklist