def test_datarray_scatter(
    x, y, z, hue, markersize, row, col, add_legend, add_colorbar
) -> None:
    """Test datarray scatter. Merge with TestPlot1D eventually."""
    ds = xr.tutorial.scatter_example_dataset()

    extra_coords = [v for v in [x, hue, markersize] if v is not None]

    # Base coords:
    coords = dict(ds.coords)

    # Add extra coords to the DataArray:
    coords.update({v: ds[v] for v in extra_coords})

    darray = xr.DataArray(ds[y], coords=coords)

    with figure_context():
        darray.plot.scatter(
            x=x,
            z=z,
            hue=hue,
            markersize=markersize,
            add_legend=add_legend,
            add_colorbar=add_colorbar,
        )
Test datarray scatter. Merge with TestPlot1D eventually.
xarray/tests/test_plot.py