We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2e68ff commit 333b2eaCopy full SHA for 333b2ea
lib/matplotlib/dates.py
@@ -430,6 +430,11 @@ def date2num(d):
430
For details see the module docstring.
431
"""
432
433
+ if hasattr(d, "values"):
434
+ d = d.values
435
+ if hasattr(d, "to_pydatetime"):
436
+ d = d.to_pydatetime()
437
+
438
if ((isinstance(d, np.ndarray) and np.issubdtype(d.dtype, np.datetime64))
439
or isinstance(d, np.datetime64)):
440
return _dt64_to_ordinalf(d)
lib/matplotlib/units.py
@@ -154,6 +154,11 @@ def get_converter(self, x):
154
# DISABLED cached = self._cached.get(idx)
155
# DISABLED if cached is not None: return cached
156
157
+ if hasattr(x, "values"):
158
+ x = x.values
159
+ if hasattr(x, "to_pydatetime"):
160
+ x = x.to_pydatetime()
161
162
converter = None
163
classx = getattr(x, '__class__', None)
164
0 commit comments