Skip to content

Commit 9bd9044

Browse files
authored
add a test for scatter colorbar extend (#7616)
* add a test for scatter colorbar extend * fix mypy issues
1 parent 4faecb4 commit 9bd9044

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

xarray/tests/test_plot.py

+8
Original file line numberDiff line numberDiff line change
@@ -2110,6 +2110,14 @@ def test_colorbar(self) -> None:
21102110

21112111
assert 1 == len(find_possible_colorbars())
21122112

2113+
def test_colorbar_scatter(self) -> None:
2114+
ds = Dataset({"a": (("x", "y"), np.arange(4).reshape(2, 2))})
2115+
fg: xplt.FacetGrid = ds.plot.scatter(x="a", y="a", row="x", hue="a")
2116+
cbar = fg.cbar
2117+
assert cbar is not None
2118+
assert cbar.vmin == 0
2119+
assert cbar.vmax == 3
2120+
21132121
@pytest.mark.slow
21142122
def test_empty_cell(self) -> None:
21152123
g = xplt.FacetGrid(self.darray, col="z", col_wrap=2)

0 commit comments

Comments
 (0)