From 9bd9044c4f1d112572c81c768e6c0f018a28c7ff Mon Sep 17 00:00:00 2001 From: Mick Date: Mon, 13 Mar 2023 20:47:49 +0100 Subject: [PATCH] add a test for scatter colorbar extend (#7616) * add a test for scatter colorbar extend * fix mypy issues --- xarray/tests/test_plot.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xarray/tests/test_plot.py b/xarray/tests/test_plot.py index 40204691e85..f736a851d7e 100644 --- a/xarray/tests/test_plot.py +++ b/xarray/tests/test_plot.py @@ -2110,6 +2110,14 @@ def test_colorbar(self) -> None: assert 1 == len(find_possible_colorbars()) + def test_colorbar_scatter(self) -> None: + ds = Dataset({"a": (("x", "y"), np.arange(4).reshape(2, 2))}) + fg: xplt.FacetGrid = ds.plot.scatter(x="a", y="a", row="x", hue="a") + cbar = fg.cbar + assert cbar is not None + assert cbar.vmin == 0 + assert cbar.vmax == 3 + @pytest.mark.slow def test_empty_cell(self) -> None: g = xplt.FacetGrid(self.darray, col="z", col_wrap=2)