MCPcopy Index your code
hub / github.com/pydata/xarray / test_coord_with_interval_step

Method test_coord_with_interval_step

xarray/tests/test_plot.py:878–884  ·  view source on GitHub ↗

Test step plot with intervals.

(self)

Source from the content-addressed store, hash-verified

876 assert hdl[0].get_drawstyle() == f"steps-{where}"
877
878 def test_coord_with_interval_step(self) -> None:
879 """Test step plot with intervals."""
880 bins = [-1, 0, 1, 2]
881 self.darray.groupby_bins("dim_0", bins).mean(...).plot.step()
882 line = plt.gca().lines[0]
883 assert isinstance(line, mpl.lines.Line2D)
884 assert len(np.asarray(line.get_xdata())) == ((len(bins) - 1) * 2)
885
886 def test_coord_with_interval_step_x(self) -> None:
887 """Test step plot with intervals explicitly on x axis."""

Callers

nothing calls this directly

Calls 3

stepMethod · 0.45
meanMethod · 0.45
groupby_binsMethod · 0.45

Tested by

no test coverage detected