MCPcopy Index your code
hub / github.com/plotly/plotly.py / test_imshow_xarray

Function test_imshow_xarray

tests/test_optional/test_px/test_imshow.py:194–202  ·  view source on GitHub ↗
(binary_string)

Source from the content-addressed store, hash-verified

192
193@pytest.mark.parametrize("binary_string", [False, True])
194def test_imshow_xarray(binary_string):
195 img = np.random.random((20, 30))
196 da = xr.DataArray(img, dims=["dim_rows", "dim_cols"])
197 fig = px.imshow(da, binary_string=binary_string)
198 # Dimensions are used for axis labels and coordinates
199 assert fig.layout.xaxis.title.text == "dim_cols"
200 assert fig.layout.yaxis.title.text == "dim_rows"
201 if not binary_string:
202 assert np.all(np.array(fig.data[0].x) == np.array(da.coords["dim_cols"]))
203
204
205def test_imshow_xarray_slicethrough():

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.45

Tested by

no test coverage detected