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

Method test_convenient_facetgrid

xarray/tests/test_plot.py:640–654  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

638 @pytest.mark.slow
639 @pytest.mark.filterwarnings("ignore:tight_layout cannot")
640 def test_convenient_facetgrid(self) -> None:
641 a = easy_array((10, 15, 4))
642 d = DataArray(a, dims=["y", "x", "z"])
643 d.coords["z"] = list("abcd")
644 g = d.plot(x="x", y="y", col="z", col_wrap=2, cmap="cool") # type: ignore[call-arg]
645
646 assert_array_equal(g.axs.shape, [2, 2])
647 for ax in g.axs.flat:
648 assert ax.has_data()
649
650 with pytest.raises(ValueError, match=r"[Ff]acet"):
651 d.plot(x="x", y="y", col="z", ax=plt.gca()) # type: ignore[call-arg]
652
653 with pytest.raises(ValueError, match=r"[Ff]acet"):
654 d[0].plot(x="x", y="y", col="z", ax=plt.gca()) # type: ignore[call-arg]
655
656 @pytest.mark.slow
657 def test_subplot_kws(self) -> None:

Callers

nothing calls this directly

Calls 4

DataArrayClass · 0.90
easy_arrayFunction · 0.85
plotMethod · 0.80
has_dataMethod · 0.80

Tested by

no test coverage detected