-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Fix Annulus width check #27811
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
Fix Annulus width check #27811
Conversation
Fix check on annulus width to reflect the error message printed. The logic is presented in this (slightly) convoluted form to better conform with the error message. Obviously, `if min(self.a, self.b) < width:` works just as well. This fix will allow annuli to be equivalent to Circles (in terms of area plotted, not underlying object structure). This means plotting (`_recompute_path`, I believe) could be improved by checking for `if w==a or w==b: PLOT WITHOUT HOLE`. Not sure how that would work, but everything does seem to work even without that change.
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.
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.
You can also join us on gitter 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.
We're in agreement on this. Co-authored-by: Tim Hoffmann <[email protected]>
Co-authored-by: Elliott Sales de Andrade <[email protected]>
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.
Probably can squash when merging.
Thanks and congratulations on your first contribution to Matplotlib 🚀 . We hope to see you again. |
Wow! < 24 h to get this in! Thank you so much. Glad to contribute. |
* Update patches.py Fix check on annulus width to reflect the error message printed. The logic is presented in this (slightly) convoluted form to better conform with the error message. Obviously, `if min(self.a, self.b) < width:` works just as well. This fix will allow annuli to be equivalent to Circles (in terms of area plotted, not underlying object structure). This means plotting (`_recompute_path`, I believe) could be improved by checking for `if w==a or w==b: PLOT WITHOUT HOLE`. Not sure how that would work, but everything does seem to work even without that change. * Update lib/matplotlib/patches.py We're in agreement on this. Co-authored-by: Tim Hoffmann <[email protected]> * Update lib/matplotlib/patches.py Co-authored-by: Elliott Sales de Andrade <[email protected]> --------- Co-authored-by: Tim Hoffmann <[email protected]> Co-authored-by: Elliott Sales de Andrade <[email protected]>
* Update patches.py Fix check on annulus width to reflect the error message printed. The logic is presented in this (slightly) convoluted form to better conform with the error message. Obviously, `if min(self.a, self.b) < width:` works just as well. This fix will allow annuli to be equivalent to Circles (in terms of area plotted, not underlying object structure). This means plotting (`_recompute_path`, I believe) could be improved by checking for `if w==a or w==b: PLOT WITHOUT HOLE`. Not sure how that would work, but everything does seem to work even without that change. * Update lib/matplotlib/patches.py We're in agreement on this. Co-authored-by: Tim Hoffmann <[email protected]> * Update lib/matplotlib/patches.py Co-authored-by: Elliott Sales de Andrade <[email protected]> --------- Co-authored-by: Tim Hoffmann <[email protected]> Co-authored-by: Elliott Sales de Andrade <[email protected]>
Fix check on annulus width to reflect the error message printed. The logic is presented in this (slightly) convoluted form to better conform with the error message. Obviously, the more concise
if min(self.a, self.b) < width:
works just as well.This fix will allow annuli to be equivalent to Circles (in terms of area plotted, not underlying object structure). This means plotting (
_recompute_path
, I believe) could be improved by checking forif w==a or w==b: PLOT WITHOUT HOLE
. Not sure how that would work, but everything does seem to work even without that change.PR summary
PR checklist