-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix axline
for slopes <= 1E-8. Closes #28386
#28754
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
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.
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.
axline
for slopes <= 1E-8. Addresses issue #28386axline
for slopes <= 1E-8. Closes #28386
Thank you for this! However, I do not think this is the right fix. Now, there will be issues with slope = 1e-9? I think a better fix is to detect the case here: matplotlib/lib/matplotlib/lines.py Lines 1516 to 1519 in 3eda5a3
so set a variable matplotlib/lib/matplotlib/lines.py Line 1502 in 3eda5a3
Use this to detect if a manual slope is provided by rewriting (I am sure that one can get that approach to behave weird as well, but assuming that the use case is to have a small slope with a suitable small range, I think it is a more robust approach.) |
I closed the PR because I mistakenly initiated it from the main branch of my forked repository. I'll be creating a new PR from a separate branch after revisiting the development workflow guide. Thanks for being patient with me and my first PR. |
PR summary
This pull request addresses #28386
Changes:
Manually set the tolerance for
np.isclose
as suggested by Andresporcruz in the dormant pull request Fixaxline
for slopes < 1E-8 #28431.Write a test in
test_lines.py
to ensureaxline
doesn't plot horizontal lines for slopes <= 1E-8.A demonstration that shows the issue has been fixed:
PR checklist