Skip to content

Commit bc8d7f9

Browse files
TST: check datetime converter is Matplotlibs (#6128)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 8309599 commit bc8d7f9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

xarray/tests/test_plot.py

+6
Original file line numberDiff line numberDiff line change
@@ -2670,6 +2670,12 @@ def test_datetime_line_plot(self):
26702670
# test if line plot raises no Exception
26712671
self.darray.plot.line()
26722672

2673+
def test_datetime_units(self):
2674+
# test that matplotlib-native datetime works:
2675+
fig, ax = plt.subplots()
2676+
ax.plot(self.darray["time"], self.darray)
2677+
assert isinstance(ax.xaxis.get_major_locator(), mpl.dates.AutoDateLocator)
2678+
26732679

26742680
@pytest.mark.filterwarnings("ignore:setting an array element with a sequence")
26752681
@requires_nc_time_axis

0 commit comments

Comments
 (0)