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

Method test_facetgrid_hue_style

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

Source from the content-addressed store, hash-verified

2950 ds2.plot.scatter(x="A", y="B", hue="hue")
2951
2952 def test_facetgrid_hue_style(self) -> None:
2953 ds2 = self.ds.copy()
2954
2955 # Numbers plots as continuous:
2956 g = ds2.plot.scatter(x="A", y="B", row="row", col="col", hue="hue")
2957 assert isinstance(g._mappables[-1], mpl.collections.PathCollection)
2958
2959 # Datetimes plots as categorical:
2960 # TODO: Currently plots as categorical, should it behave as numerical?
2961 ds2["hue"] = pd.date_range("2000-1-1", periods=4)
2962 g = ds2.plot.scatter(x="A", y="B", row="row", col="col", hue="hue")
2963 assert isinstance(g._mappables[-1], mpl.collections.PathCollection)
2964
2965 # Strings plots as categorical:
2966 ds2["hue"] = ["a", "a", "b", "b"]
2967 g = ds2.plot.scatter(x="A", y="B", row="row", col="col", hue="hue")
2968 assert isinstance(g._mappables[-1], mpl.collections.PathCollection)
2969
2970 @pytest.mark.parametrize(
2971 ["x", "y", "hue", "markersize"],

Callers

nothing calls this directly

Calls 2

copyMethod · 0.45
scatterMethod · 0.45

Tested by

no test coverage detected