| 232 | xr.ones_like(self.darray[:, 0, 0], dtype=bool).plot() # type: ignore[call-arg] |
| 233 | |
| 234 | def test_1d_x_y_kw(self) -> None: |
| 235 | z = np.arange(10) |
| 236 | da = DataArray(np.cos(z), dims=["z"], coords=[z], name="f") |
| 237 | |
| 238 | xy: list[list[str | None]] = [[None, None], [None, "z"], ["z", None]] |
| 239 | |
| 240 | _f, axs = plt.subplots(3, 1, squeeze=False) |
| 241 | for aa, (x, y) in enumerate(xy): |
| 242 | da.plot(x=x, y=y, ax=axs.flat[aa]) # type: ignore[call-arg] |
| 243 | |
| 244 | with pytest.raises(ValueError, match=r"Cannot specify both"): |
| 245 | da.plot(x="z", y="z") # type: ignore[call-arg] |
| 246 | |
| 247 | error_msg = "must be one of None, 'z'" |
| 248 | with pytest.raises(ValueError, match=rf"x {error_msg}"): |
| 249 | da.plot(x="f") # type: ignore[call-arg] |
| 250 | |
| 251 | with pytest.raises(ValueError, match=rf"y {error_msg}"): |
| 252 | da.plot(y="f") # type: ignore[call-arg] |
| 253 | |
| 254 | def test_multiindex_level_as_coord(self) -> None: |
| 255 | da = xr.DataArray( |