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

Method test_coord_with_interval_step_x

xarray/tests/test_plot.py:886–892  ·  view source on GitHub ↗

Test step plot with intervals explicitly on x axis.

(self)

Source from the content-addressed store, hash-verified

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."""
888 bins = [-1, 0, 1, 2]
889 self.darray.groupby_bins("dim_0", bins).mean(...).plot.step(x="dim_0_bins")
890 line = plt.gca().lines[0]
891 assert isinstance(line, mpl.lines.Line2D)
892 assert len(np.asarray(line.get_xdata())) == ((len(bins) - 1) * 2)
893
894 def test_coord_with_interval_step_y(self) -> None:
895 """Test step plot with intervals explicitly on y axis."""

Callers

nothing calls this directly

Calls 3

stepMethod · 0.45
meanMethod · 0.45
groupby_binsMethod · 0.45

Tested by

no test coverage detected