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

Function test_plot_transposed_nondim_coord

xarray/tests/test_plot.py:3234–3247  ·  view source on GitHub ↗
(plotfunc)

Source from the content-addressed store, hash-verified

3232@requires_matplotlib
3233@pytest.mark.parametrize("plotfunc", ["pcolormesh", "contourf", "contour"])
3234def test_plot_transposed_nondim_coord(plotfunc) -> None:
3235 x = np.linspace(0, 10, 101)
3236 h = np.linspace(3, 7, 101)
3237 s = np.linspace(0, 1, 51)
3238 z = s[:, np.newaxis] * h[np.newaxis, :]
3239 da = xr.DataArray(
3240 np.sin(x) * np.cos(z),
3241 dims=["s", "x"],
3242 coords={"x": x, "s": s, "z": (("s", "x"), z), "zt": (("x", "s"), z.T)},
3243 )
3244 with figure_context():
3245 getattr(da.plot, plotfunc)(x="x", y="zt")
3246 with figure_context():
3247 getattr(da.plot, plotfunc)(x="zt", y="x")
3248
3249
3250@requires_matplotlib

Callers

nothing calls this directly

Calls 3

figure_contextFunction · 0.85
linspaceMethod · 0.80
sinMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…