MCPcopy
hub / github.com/pydata/xarray / test_non_numeric_legend

Method test_non_numeric_legend

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

Source from the content-addressed store, hash-verified

2980 self.ds.plot.scatter(x=x, y=y, u="col", v="row")
2981
2982 def test_non_numeric_legend(self) -> None:
2983 ds2 = self.ds.copy()
2984 ds2["hue"] = ["a", "b", "c", "d"]
2985 pc = ds2.plot.scatter(x="A", y="B", markersize="hue")
2986 axes = pc.axes
2987 assert axes is not None
2988 # should make a discrete legend
2989 assert hasattr(axes, "legend_")
2990 assert axes.legend_ is not None
2991
2992 def test_legend_labels(self) -> None:
2993 # regression test for #4126: incorrect legend labels

Callers

nothing calls this directly

Calls 2

copyMethod · 0.45
scatterMethod · 0.45

Tested by

no test coverage detected