Test datarray scatter. Merge with TestPlot1D eventually.
(
x, y, z, hue, markersize, row, col, add_legend, add_colorbar
)
| 3399 | ], |
| 3400 | ) |
| 3401 | def test_datarray_scatter( |
| 3402 | x, y, z, hue, markersize, row, col, add_legend, add_colorbar |
| 3403 | ) -> None: |
| 3404 | """Test datarray scatter. Merge with TestPlot1D eventually.""" |
| 3405 | ds = xr.tutorial.scatter_example_dataset() |
| 3406 | |
| 3407 | extra_coords = [v for v in [x, hue, markersize] if v is not None] |
| 3408 | |
| 3409 | # Base coords: |
| 3410 | coords = dict(ds.coords) |
| 3411 | |
| 3412 | # Add extra coords to the DataArray: |
| 3413 | coords.update({v: ds[v] for v in extra_coords}) |
| 3414 | |
| 3415 | darray = xr.DataArray(ds[y], coords=coords) |
| 3416 | |
| 3417 | with figure_context(): |
| 3418 | darray.plot.scatter( |
| 3419 | x=x, |
| 3420 | z=z, |
| 3421 | hue=hue, |
| 3422 | markersize=markersize, |
| 3423 | add_legend=add_legend, |
| 3424 | add_colorbar=add_colorbar, |
| 3425 | ) |
| 3426 | |
| 3427 | |
| 3428 | @requires_dask |
nothing calls this directly
no test coverage detected
searching dependent graphs…