Skip to content

Commit

Permalink
Update test_plot.py
Browse files Browse the repository at this point in the history
added testcase for pydata#7014
  • Loading branch information
veenstrajelmer authored Feb 23, 2023
1 parent 1de881e commit 3d84b2c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xarray/tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,11 @@ def test_discrete_colormap_provided_boundary_norm(self) -> None:
norm = mpl.colors.BoundaryNorm([0, 5, 10, 15], 4)
primitive = self.darray.plot.contourf(norm=norm)
np.testing.assert_allclose(primitive.levels, norm.boundaries)

def test_discrete_colormap_provided_boundary_norm_matching_cmap_levels(self):
norm = mpl.colors.BoundaryNorm([0, 5, 10, 15], 4)
primitive = self.darray.plot.contourf(norm=norm)
assert primitive.colorbar.norm.Ncmap+1 == primitive.colorbar.norm.N


class Common2dMixin:
Expand Down

0 comments on commit 3d84b2c

Please sign in to comment.