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

Method test_coord_with_interval_step_y

xarray/tests/test_plot.py:894–900  ·  view source on GitHub ↗

Test step plot with intervals explicitly on y axis.

(self)

Source from the content-addressed store, hash-verified

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."""
896 bins = [-1, 0, 1, 2]
897 self.darray.groupby_bins("dim_0", bins).mean(...).plot.step(y="dim_0_bins")
898 line = plt.gca().lines[0]
899 assert isinstance(line, mpl.lines.Line2D)
900 assert len(np.asarray(line.get_xdata())) == ((len(bins) - 1) * 2)
901
902 def test_coord_with_interval_step_x_and_y_raises_valueeerror(self) -> None:
903 """Test that step plot with intervals both on x and y axes raises an error."""

Callers

nothing calls this directly

Calls 3

stepMethod · 0.45
meanMethod · 0.45
groupby_binsMethod · 0.45

Tested by

no test coverage detected