Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Feb 9, 2018
1 parent 6f97143 commit ba7396e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions xarray/tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,13 @@ def test_normalize_rgb_one_arg_error(self):
for kwds in [dict(vmax=-1, vmin=-1.2), dict(vmin=2, vmax=2.1)]:
da.plot.imshow(**kwds)

def test_imshow_rgb_values_in_valid_range(self):
da = DataArray(np.arange(75, dtype='uint8').reshape((5, 5, 3)))
_, ax = plt.subplots()
out = da.plot.imshow(ax=ax).get_array()
assert out.dtype == np.uint8
assert (out[...,:3] == da.values).all() # Compare without added alpha


class TestFacetGrid(PlotTestCase):
def setUp(self):
Expand Down

0 comments on commit ba7396e

Please sign in to comment.