(self)
| 3060 | assert type(ax.xaxis.get_major_locator()) is mpl.dates.AutoDateLocator |
| 3061 | |
| 3062 | def test_datetime_plot2d(self) -> None: |
| 3063 | # Test that matplotlib-native datetime works: |
| 3064 | da = DataArray( |
| 3065 | np.arange(3 * 4).reshape(3, 4), |
| 3066 | dims=("x", "y"), |
| 3067 | coords={ |
| 3068 | "x": [1, 2, 3], |
| 3069 | "y": [np.datetime64(f"2000-01-{x:02d}") for x in range(1, 5)], |
| 3070 | }, |
| 3071 | ) |
| 3072 | |
| 3073 | p = da.plot.pcolormesh() |
| 3074 | ax = p.axes |
| 3075 | assert ax is not None |
| 3076 | |
| 3077 | # Make sure only mpl converters are used, use type() so only |
| 3078 | # mpl.dates.AutoDateLocator passes and no other subclasses: |
| 3079 | assert type(ax.xaxis.get_major_locator()) is mpl.dates.AutoDateLocator |
| 3080 | |
| 3081 | |
| 3082 | @pytest.mark.filterwarnings("ignore:setting an array element with a sequence") |
nothing calls this directly
no test coverage detected