Document and fix AngleAnnotation constructor default case of using the current Axes - #32179
Conversation
`AngleAnnotation` is already designed such that the current Axes will be used by default if no Axes are passed explicitly. Document this behavior. Call `annotate` on the correctly initialized class attribute `self.ax` instead of the constructor argument `ax`, which is `None` in the default case.
|
Thank you for opening your first PR into Matplotlib! If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process. You can also join us on discourse chat for real-time discussion. For details on testing, writing docs, and our review process, please see the developer guide. We strive to be a welcoming and open project. Please follow our Code of Conduct. |
story645
left a comment
There was a problem hiding this comment.
Thanks for the fix, was there anything (like weird behavior or the like) that led you to catch this mistake?
|
@meeseeksdev backport to v3.11.x |
My linter discovered it, actually. I adopted the class in my codebase and ty complained that "Attribute |
…fault case of using the current Axes (#32180) Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
PR summary
The provided
AngleAnnotationclass is already designed such that the current Axes will be used by default if no Axes are passed explicitly. Document this behavior. Callannotateon the correctly initialized class attributeself.axinstead of the constructor argumentax, which isNonein the default case.AI Disclosure
No AI was used.
PR quality check