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

Method test_map_dataset

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

Source from the content-addressed store, hash-verified

2454
2455 @pytest.mark.slow
2456 def test_map_dataset(self) -> None:
2457 g = xplt.FacetGrid(self.darray.to_dataset(name="foo"), col="z")
2458 g.map(plt.contourf, "x", "y", "foo")
2459
2460 alltxt = text_in_fig()
2461 for label in ["x", "y"]:
2462 assert label in alltxt
2463 # everything has a label
2464 assert "None" not in alltxt
2465
2466 # colorbar can't be inferred automatically
2467 assert "foo" not in alltxt
2468 assert 0 == len(find_possible_colorbars())
2469
2470 g.add_colorbar(label="colors!")
2471 assert "colors!" in text_in_fig()
2472 assert 1 == len(find_possible_colorbars())
2473
2474 @pytest.mark.slow
2475 def test_set_axis_labels(self) -> None:

Callers

nothing calls this directly

Calls 5

mapMethod · 0.95
add_colorbarMethod · 0.95
text_in_figFunction · 0.85
find_possible_colorbarsFunction · 0.85
to_datasetMethod · 0.45

Tested by

no test coverage detected