MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_transformed_path

Function test_transformed_path

lib/matplotlib/tests/test_transforms.py:984–997  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

982
983
984def test_transformed_path():
985 points = [(0, 0), (1, 0), (1, 1), (0, 1)]
986 path = Path(points, closed=True)
987
988 trans = mtransforms.Affine2D()
989 trans_path = mtransforms.TransformedPath(path, trans)
990 assert_allclose(trans_path.get_fully_transformed_path().vertices, points)
991
992 # Changing the transform should change the result.
993 r2 = 1 / np.sqrt(2)
994 trans.rotate(np.pi / 4)
995 assert_allclose(trans_path.get_fully_transformed_path().vertices,
996 [(0, 0), (r2, r2), (0, 2 * r2), (-r2, r2)],
997 atol=1e-15)
998
999
1000def test_transformed_patch_path():

Callers

nothing calls this directly

Calls 4

rotateMethod · 0.95
PathClass · 0.90
sqrtMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…