Skip to content

TST: check datetime converter is Matplotlibs #6128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions xarray/tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2670,6 +2670,12 @@ def test_datetime_line_plot(self):
# test if line plot raises no Exception
self.darray.plot.line()

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


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