Skip to content

Commit c2bbdf2

Browse files
committed
Add failing tests for step plot with hue
1 parent 15c6182 commit c2bbdf2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

xarray/tests/test_plot.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,24 @@ def test_step_with_where(self, where):
796796
hdl = self.darray[0, 0].plot.step(where=where)
797797
assert hdl[0].get_drawstyle() == f"steps-{where}"
798798

799+
def test_step_with_hue(self):
800+
hdl = self.darray[0].plot.step(hue="dim_2")
801+
assert hdl[0].get_drawstyle() == "steps"
802+
803+
@pytest.mark.parametrize("where", ["pre", "post", "mid"])
804+
def test_step_with_hue_and_where(self, where):
805+
hdl = self.darray[0].plot.step(hue="dim_2", where=where)
806+
assert hdl[0].get_drawstyle() == f"steps-{where}"
807+
808+
def test_drawstyle_steps(self):
809+
hdl = self.darray[0].plot(hue="dim_2", drawstyle="steps")
810+
assert hdl[0].get_drawstyle() == "steps"
811+
812+
@pytest.mark.parametrize("where", ["pre", "post", "mid"])
813+
def test_drawstyle_steps_with_where(self, where):
814+
hdl = self.darray[0].plot(hue="dim_2", drawstyle=f"steps-{where}")
815+
assert hdl[0].get_drawstyle() == f"steps-{where}"
816+
799817
def test_coord_with_interval_step(self):
800818
"""Test step plot with intervals."""
801819
bins = [-1, 0, 1, 2]

0 commit comments

Comments
 (0)