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

Method test_legend_labels

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

Source from the content-addressed store, hash-verified

2990 assert axes.legend_ is not None
2991
2992 def test_legend_labels(self) -> None:
2993 # regression test for #4126: incorrect legend labels
2994 ds2 = self.ds.copy()
2995 ds2["hue"] = ["a", "a", "b", "b"]
2996 pc = ds2.plot.scatter(x="A", y="B", markersize="hue")
2997 axes = pc.axes
2998 assert axes is not None
2999 legend = axes.get_legend()
3000 assert legend is not None
3001 actual = [t.get_text() for t in legend.texts]
3002 expected = ["hue", "a", "b"]
3003 assert actual == expected
3004
3005 def test_legend_labels_facetgrid(self) -> None:
3006 ds2 = self.ds.copy()

Callers

nothing calls this directly

Calls 2

copyMethod · 0.45
scatterMethod · 0.45

Tested by

no test coverage detected