-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Changed 'colors' parameter in PyPlot vlines/hlines and Axes vlines/hlines to default to configured rcParams 'lines.color' option #16953
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
Can you please use I think the only change we actually need here is for the default to be |
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.
Please:
- fix implementation
- remove new images (and rebase out of history)
@tacaswell I updated the implementation inline with your review, as well as rebased the image comparators out of the git history |
Thanks @McCoubs ! This is definitely heading in the right direction. |
@tacaswell thanks for the encouragement, I've updated again inline with your comments |
The tests look great. Only a minor change to the implementation and getting the docs to build left! |
@tacaswell @QuLogic I've made changes inline with your comments |
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.
Can you rebase to remove the merges, and maybe squash down the commits a bit?
lib/matplotlib/tests/test_axes.py
Outdated
@@ -3977,6 +3977,17 @@ def test_vlines(): | |||
ax5.set_xlim(0, 15) | |||
|
|||
|
|||
@check_figures_equal(extensions=["png"]) |
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.
A figure comparison is more effort than needed. One could simply create the colors of the returned LineCollection
.
I'm not insisting on that type of test here, but IMHO it would be more compact and faster. I've not timed figure comparisons, but since the test suite already runs for a long time, it may be worth keeping an eye at adding efficient tests.
907c167
to
03277e7
Compare
@QuLogic @tacaswell I've updated with your review and squashed/rebased away any unnecessary commits |
I approved before, and still approve, but tests need to be passing. See also @timhoffm's suggestion. |
@McCoubs This needs another rebase. I tried to do it and push to your branch but it won't let me (you must have un-checked the "allow maintainers to push" box?). |
And as long as you are rebasing would you mind also squashing to one commit? |
@tacaswell I rebased and squashed into 1 commit, but I don't seem to see the checkbox you mentioned for "allow maintainers to push" |
It should be at the end of the sidebar on the right, though maybe it's not really needed now. |
This needs a rebase again; also see @timhoffm's comments about the tests. |
As written above, I'd prefer rewriting the tests but I'm not strictly insisting. Either way, please acknowledge the proposal and comment why you would or would not follow it. |
@timhoffm sorry about the slow response time; due to current circumstances I have been quite busy. After considering your proposal I agree that asserting the colours from the LineCollection matches expected will be faster. I'll update and rebase with the change |
…ine with issue matplotlib#16482 added test coverage for changes to pyplot hlines() and vlines() interface adding API changes to api_changes updated Axes.vlines and Axes.hline docstring inline with changes updated spacing to be 2 line compliant updated implementation for iss-16482 inline with review comments removed unnecessary import of image_comparator decorator running boilerplate.py to update vlines/hlines methods updating inline with review comments fixing flake8 errors updating inline with reviewer comments updating inline with reviewer comments updated vlines/hlines default color tests inline with code review
PR Summary
Addresses issue #16482, wherein the configured 'lines.color' parameter of rcParams was not being used as the default parameter for the vlines/hlines methods of both the PyPlot and Axes API.
PR Checklist