Skip to content

Commit

Permalink
added tests for fix of issue pandas-dev#16953
Browse files Browse the repository at this point in the history
  • Loading branch information
s-weigand committed Sep 4, 2017
1 parent 84a8cc2 commit f8dcb84
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pandas/tests/plotting/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,25 @@ def test_subplots_timeseries(self):
self._check_ticks_props(ax, xlabelsize=7, xrot=45,
ylabelsize=7)

def test_subplots_timeseries_y_axis(self):
# tests for fix of issue #16953
testdata = DataFrame({"numeric": np.array([1, 2, 5]),
"timedelta": [pd.Timedelta(10, unit="s"),
pd.Timedelta(10, unit="m"),
pd.Timedelta(10, unit="h")],
"datetime": [pd.to_datetime("2017-08-01 00:00:00"),
pd.to_datetime("2017-08-01 02:00:00"),
pd.to_datetime("2017-08-02 00:00:00")],
"text": ["This", "should", "fail"]})
ax_numeric = testdata.plot(y="numeric")
assert (ax_numeric.get_lines()[0].get_data()[1] == testdata["numeric"].values).all()
ax_timedelta = testdata.plot(y="timedelta")
assert (ax_timedelta.get_lines()[0].get_data()[1] == testdata["timedelta"].values).all()
ax_datetime = testdata.plot(y="datetime")
assert (ax_datetime.get_lines()[0].get_data()[1] == testdata["datetime"].values).all()
with pytest.raises(TypeError):
testdata.plot(y="text")

@pytest.mark.slow
def test_subplots_layout(self):
# GH 6667
Expand Down

0 comments on commit f8dcb84

Please sign in to comment.