MCPcopy
hub / github.com/pydata/xarray / test_datarray_scatter

Function test_datarray_scatter

xarray/tests/test_plot.py:3401–3425  ·  view source on GitHub ↗

Test datarray scatter. Merge with TestPlot1D eventually.

(
    x, y, z, hue, markersize, row, col, add_legend, add_colorbar
)

Source from the content-addressed store, hash-verified

3399 ],
3400)
3401def 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

Callers

nothing calls this directly

Calls 3

figure_contextFunction · 0.85
updateMethod · 0.45
scatterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…