(self)
| 1628 | |
| 1629 | @pytest.mark.filterwarnings("ignore:tight_layout cannot") |
| 1630 | def test_convenient_facetgrid(self) -> None: |
| 1631 | a = easy_array((10, 15, 4)) |
| 1632 | d = DataArray(a, dims=["y", "x", "z"]) |
| 1633 | g = self.plotfunc(d, x="x", y="y", col="z", col_wrap=2) |
| 1634 | |
| 1635 | assert_array_equal(g.axs.shape, [2, 2]) |
| 1636 | for (y, x), ax in np.ndenumerate(g.axs): |
| 1637 | assert ax.has_data() |
| 1638 | if x == 0: |
| 1639 | assert "y" == ax.get_ylabel() |
| 1640 | else: |
| 1641 | assert "" == ax.get_ylabel() |
| 1642 | if y == 1: |
| 1643 | assert "x" == ax.get_xlabel() |
| 1644 | else: |
| 1645 | assert "" == ax.get_xlabel() |
| 1646 | |
| 1647 | # Inferring labels |
| 1648 | g = self.plotfunc(d, col="z", col_wrap=2) |
| 1649 | assert_array_equal(g.axs.shape, [2, 2]) |
| 1650 | for (y, x), ax in np.ndenumerate(g.axs): |
| 1651 | assert ax.has_data() |
| 1652 | if x == 0: |
| 1653 | assert "y" == ax.get_ylabel() |
| 1654 | else: |
| 1655 | assert "" == ax.get_ylabel() |
| 1656 | if y == 1: |
| 1657 | assert "x" == ax.get_xlabel() |
| 1658 | else: |
| 1659 | assert "" == ax.get_xlabel() |
| 1660 | |
| 1661 | @pytest.mark.filterwarnings("ignore:tight_layout cannot") |
| 1662 | def test_convenient_facetgrid_4d(self) -> None: |
nothing calls this directly
no test coverage detected