Skip to content

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

Merged
merged 3 commits into from
Feb 23, 2024
Merged

Conversation

drbergman
Copy link
Contributor

@drbergman drbergman commented Feb 22, 2024

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 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.

PR summary

PR checklist

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.
Copy link

@github-actions github-actions bot left a 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.

drbergman and others added 2 commits February 22, 2024 20:17
We're in agreement on this.

Co-authored-by: Tim Hoffmann <[email protected]>
Co-authored-by: Elliott Sales de Andrade <[email protected]>
Copy link
Member

@QuLogic QuLogic left a 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.

@timhoffm timhoffm merged commit dcd1d23 into matplotlib:main Feb 23, 2024
@QuLogic QuLogic added this to the v3.9.0 milestone Feb 23, 2024
@timhoffm
Copy link
Member

Thanks and congratulations on your first contribution to Matplotlib 🚀 . We hope to see you again.

@drbergman
Copy link
Contributor Author

Wow! < 24 h to get this in! Thank you so much. Glad to contribute.

Impaler343 pushed a commit to Impaler343/matplotlib that referenced this pull request Mar 8, 2024
* 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]>
Impaler343 pushed a commit to Impaler343/matplotlib that referenced this pull request Mar 14, 2024
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants