| 269 | |
| 270 | # Test for bug in GH issue #2725 |
| 271 | def test_infer_line_data(self) -> None: |
| 272 | current = DataArray( |
| 273 | name="I", |
| 274 | data=np.array([5, 8]), |
| 275 | dims=["t"], |
| 276 | coords={ |
| 277 | "t": (["t"], np.array([0.1, 0.2])), |
| 278 | "V": (["t"], np.array([100, 200])), |
| 279 | }, |
| 280 | ) |
| 281 | |
| 282 | # Plot current against voltage |
| 283 | line = current.plot.line(x="V")[0] |
| 284 | assert_array_equal(line.get_xdata(), current.coords["V"].values) |
| 285 | |
| 286 | # Plot current against time |
| 287 | line = current.plot.line()[0] |
| 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 |