-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PLT: plot('line') or plot('area') produces wrong xlim in xaxis in 0.25.0 #27993
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
PLT: plot('line') or plot('area') produces wrong xlim in xaxis in 0.25.0 #27993
Conversation
Codecov Report
@@ Coverage Diff @@
## master #27993 +/- ##
==========================================
- Coverage 93.05% 93.04% -0.01%
==========================================
Files 189 189
Lines 50058 50042 -16
==========================================
- Hits 46581 46564 -17
- Misses 3477 3478 +1
Continue to review full report at Codecov.
|
@@ -419,6 +419,7 @@ def test_get_finder(self): | |||
assert conv.get_finder("A") == conv._annual_finder | |||
assert conv.get_finder("W") == conv._daily_finder | |||
|
|||
@pytest.mark.xfail # I am not sure if this test is correct |
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 expand on this? Perhaps open a new issue with the description of the bug, and reference it.
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 post images of the output for one of the failing tests, before and after your changes?
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.
@TomAugspurger yes, i feel the best way is to xfail
the tests here and open up a new issue and do a follow-up PR to fix the tests, Because the main purpose is to test if the finder
is being correctly used or not. And I honestly do not understand especially the second one in which there is a vmin + 0.9
, I assume that's because of this wrong xaxis output, so has to manually add a constant to match the behavior.
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.
After my change: (this is also aligned with the behaviour on matplotlib)
Before my change:(i feel this is a bit wrong, because plot should start from 1987Q2, while due to this error, it starts from Q3 IIUC)
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.
Thanks... I think I agree with your assessment.
Can you open a new issue to discuss removing / updating those tests? And reference that in the skip / xfails?
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.
sure, i was thinking of doing it, but then i thought this PR would become a blocker for the issue if it is not merged because the test has to use the output of this PR. Probably I just overthink it ^^ thanks, will open and reference it. @TomAugspurger
Can you move the release note to 1.0.0.rst? |
Thanks @charlesdong1991! |
…5.0 (pandas-dev#27993) * Fix issue 27686
Due to previous PRs, there is an issue with xlim wrongly plotted for lines. I digged into database a bit, and found it also affects

plot(kind='area')
because they share the sameLinePlot
. And this issue is produced in both DataFrame and Series. Now looks like the issue is gone:Duplicated closed issue 27796 is solved as well:
Also looks like issue in #25160 is gone as well.

The same to #24784 looks like issue is also gone

black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff