Skip to content

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

Merged
merged 17 commits into from
Aug 20, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix wrong test
  • Loading branch information
charlesdong1991 committed Aug 18, 2019
commit 162775575c6c5581bb7ba361b73837996abecaf3
12 changes: 6 additions & 6 deletions pandas/tests/plotting/test_datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def test_finder_minutely(self):
_, ax = self.plt.subplots()
ser.plot(ax=ax)
xaxis = ax.get_xaxis()
rs = xaxis.get_majorticklocs()[0]
rs = xaxis.get_majorticklocs()[1]
xp = Period("1/1/1999", freq="Min").ordinal

assert rs == xp
Expand All @@ -534,7 +534,7 @@ def test_finder_hourly(self):
_, ax = self.plt.subplots()
ser.plot(ax=ax)
xaxis = ax.get_xaxis()
rs = xaxis.get_majorticklocs()[0]
rs = xaxis.get_majorticklocs()[1]
xp = Period("1/1/1999", freq="H").ordinal

assert rs == xp
Expand Down Expand Up @@ -1420,8 +1420,8 @@ def test_format_timedelta_ticks_narrow(self):
labels = ax.get_xticklabels()

result_labels = [x.get_text() for x in labels]
assert len(result_labels) == len(expected_labels)
assert result_labels == expected_labels
assert (len(result_labels) - 2) == len(expected_labels)
assert result_labels[1:-1] == expected_labels

def test_format_timedelta_ticks_wide(self):
expected_labels = [
Expand All @@ -1444,8 +1444,8 @@ def test_format_timedelta_ticks_wide(self):
labels = ax.get_xticklabels()

result_labels = [x.get_text() for x in labels]
assert len(result_labels) == len(expected_labels)
assert result_labels == expected_labels
assert (len(result_labels) - 2) == len(expected_labels)
assert result_labels[1:-1] == expected_labels

def test_timedelta_plot(self):
# test issue #8711
Expand Down