()
| 1345 | |
| 1346 | |
| 1347 | def test_tricontour_path(): |
| 1348 | x = [0, 4, 4, 0, 2] |
| 1349 | y = [0, 0, 4, 4, 2] |
| 1350 | triang = mtri.Triangulation(x, y) |
| 1351 | _, ax = plt.subplots() |
| 1352 | |
| 1353 | # Line strip from boundary to boundary |
| 1354 | cs = ax.tricontour(triang, [1, 0, 0, 0, 0], levels=[0.5]) |
| 1355 | paths = cs.get_paths() |
| 1356 | assert len(paths) == 1 |
| 1357 | expected_vertices = [[2, 0], [1, 1], [0, 2]] |
| 1358 | assert_array_almost_equal(paths[0].vertices, expected_vertices) |
| 1359 | assert_array_equal(paths[0].codes, [1, 2, 2]) |
| 1360 | assert_array_almost_equal( |
| 1361 | paths[0].to_polygons(closed_only=False), [expected_vertices]) |
| 1362 | |
| 1363 | # Closed line loop inside domain |
| 1364 | cs = ax.tricontour(triang, [0, 0, 0, 0, 1], levels=[0.5]) |
| 1365 | paths = cs.get_paths() |
| 1366 | assert len(paths) == 1 |
| 1367 | expected_vertices = [[3, 1], [3, 3], [1, 3], [1, 1], [3, 1]] |
| 1368 | assert_array_almost_equal(paths[0].vertices, expected_vertices) |
| 1369 | assert_array_equal(paths[0].codes, [1, 2, 2, 2, 79]) |
| 1370 | assert_array_almost_equal(paths[0].to_polygons(), [expected_vertices]) |
| 1371 | |
| 1372 | |
| 1373 | def test_tricontourf_path(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…