| 288 | assert_array_equal(line.get_xdata(), current.coords["t"].values) |
| 289 | |
| 290 | def test_line_plot_along_1d_coord(self) -> None: |
| 291 | # Test for bug in GH #3334 |
| 292 | x_coord = xr.DataArray(data=[0.1, 0.2], dims=["x"]) |
| 293 | t_coord = xr.DataArray(data=[10, 20], dims=["t"]) |
| 294 | |
| 295 | da = xr.DataArray( |
| 296 | data=np.array([[0, 1], [5, 9]]), |
| 297 | dims=["x", "t"], |
| 298 | coords={"x": x_coord, "time": t_coord}, |
| 299 | ) |
| 300 | |
| 301 | line = da.plot(x="time", hue="x")[0] # type: ignore[call-arg] |
| 302 | assert_array_equal(line.get_xdata(), da.coords["time"].values) |
| 303 | |
| 304 | line = da.plot(y="time", hue="x")[0] # type: ignore[call-arg] |
| 305 | assert_array_equal(line.get_ydata(), da.coords["time"].values) |
| 306 | |
| 307 | def test_line_plot_wrong_hue(self) -> None: |
| 308 | da = xr.DataArray( |