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

Method test_default_labels

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

Source from the content-addressed store, hash-verified

2888 assert g.axs.shape == (len(self.ds.col), len(self.ds.row))
2889
2890 def test_default_labels(self) -> None:
2891 g = self.ds.plot.scatter(x="A", y="B", row="row", col="col", hue="hue")
2892
2893 # Top row should be labeled
2894 for label, ax in zip(self.ds.coords["col"].values, g.axs[0, :], strict=True):
2895 assert substring_in_axes(str(label), ax)
2896
2897 # Bottom row should have name of x array name and units
2898 for ax in g.axs[-1, :]:
2899 assert ax.get_xlabel() == "A [Aunits]"
2900
2901 # Leftmost column should have name of y array name and units
2902 for ax in g.axs[:, 0]:
2903 assert ax.get_ylabel() == "B [Bunits]"
2904
2905 def test_axes_in_faceted_plot(self) -> None:
2906 with pytest.raises(ValueError):

Callers

nothing calls this directly

Calls 2

substring_in_axesFunction · 0.85
scatterMethod · 0.45

Tested by

no test coverage detected