Thanks to visit codestin.com Credit goes to github.com
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 caa6de5Copy full SHA for caa6de5
lib/matplotlib/dates.py
@@ -430,6 +430,9 @@ def date2num(d):
430
For details see the module docstring.
431
"""
432
433
+ if hasattr(d, "to_pydatetime"):
434
+ d = d.to_pydatetime()
435
+
436
if ((isinstance(d, np.ndarray) and np.issubdtype(d.dtype, np.datetime64))
437
or isinstance(d, np.datetime64)):
438
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