diff --git a/pandas/core/frame.py b/pandas/core/frame.py index ff5cfff9edcbe..aded67a7728a9 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -3828,7 +3828,7 @@ def plot(self, subplots=False, sharex=True, sharey=False, use_index=True, if kind == 'line': if use_index: - if self.index.is_numeric() or self.index.is_datetime(): + if self.index.is_numeric() or self.index.is_datetype(): """ Matplotlib supports numeric values or datetime objects as xaxis values. Taking LBYL approach here, by the time diff --git a/pandas/core/index.py b/pandas/core/index.py index ea6e1561253ad..e0776c05fa8eb 100644 --- a/pandas/core/index.py +++ b/pandas/core/index.py @@ -1,6 +1,6 @@ # pylint: disable=E1101,E1103,W0232 -from datetime import time, datetime +from datetime import time, datetime, date from itertools import izip import numpy as np @@ -145,9 +145,9 @@ def is_monotonic(self): def is_numeric(self): return issubclass(self.dtype.type, np.number) - def is_datetime(self): + def is_datetype(self): for key in self.values: - if not isinstance(key, datetime): + if not isinstance(key, (datetime, date)): return False return True diff --git a/pandas/core/series.py b/pandas/core/series.py index fe91a6ba9f27e..fa51be1a4f92d 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2076,7 +2076,7 @@ def plot(self, label=None, kind='line', use_index=True, rot=30, ax=None, if kind == 'line': if use_index: - if self.index.is_numeric() or self.index.is_datetime(): + if self.index.is_numeric() or self.index.is_datetype(): """ Matplotlib supports numeric values or datetime objects as xaxis values. Taking LBYL approach here, by the time