(plotfunc)
| 3250 | @requires_matplotlib |
| 3251 | @pytest.mark.parametrize("plotfunc", ["pcolormesh", "imshow"]) |
| 3252 | def test_plot_transposes_properly(plotfunc) -> None: |
| 3253 | # test that we aren't mistakenly transposing when the 2 dimensions have equal sizes. |
| 3254 | da = xr.DataArray([np.sin(2 * np.pi / 10 * np.arange(10))] * 10, dims=("y", "x")) |
| 3255 | with figure_context(): |
| 3256 | hdl = getattr(da.plot, plotfunc)(x="x", y="y") |
| 3257 | # get_array doesn't work for contour, contourf. It returns the colormap intervals. |
| 3258 | # pcolormesh returns 1D array but imshow returns a 2D array so it is necessary |
| 3259 | # to ravel() on the LHS |
| 3260 | assert_array_equal(hdl.get_array().ravel(), da.to_masked_array().ravel()) |
| 3261 | |
| 3262 | |
| 3263 | @requires_matplotlib |
nothing calls this directly
no test coverage detected
searching dependent graphs…