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

Method test_facetgrid

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

Source from the content-addressed store, hash-verified

2719 )
2720
2721 def test_facetgrid(self) -> None:
2722 with figure_context():
2723 fg = self.ds.plot.quiver(
2724 x="x", y="y", u="u", v="v", row="row", col="col", scale=1, hue="mag"
2725 )
2726 for handle in fg._mappables:
2727 assert isinstance(handle, mpl.quiver.Quiver)
2728 assert fg.quiverkey is not None
2729 assert "uunits" in fg.quiverkey.text.get_text()
2730
2731 with figure_context():
2732 fg = self.ds.plot.quiver(
2733 x="x",
2734 y="y",
2735 u="u",
2736 v="v",
2737 row="row",
2738 col="col",
2739 scale=1,
2740 hue="mag",
2741 add_guide=False,
2742 )
2743 assert fg.quiverkey is None
2744 with pytest.raises(ValueError, match=r"Please provide scale"):
2745 self.ds.plot.quiver(x="x", y="y", u="u", v="v", row="row", col="col")
2746
2747 @pytest.mark.parametrize(
2748 "add_guide, hue_style, legend, colorbar",

Callers

nothing calls this directly

Calls 2

figure_contextFunction · 0.85
quiverMethod · 0.80

Tested by

no test coverage detected