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

Function test_Affine2D_from_values

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

Source from the content-addressed store, hash-verified

515
516
517def test_Affine2D_from_values():
518 points = np.array([[0, 0],
519 [10, 20],
520 [-1, 0],
521 ])
522
523 t = mtransforms.Affine2D.from_values(1, 0, 0, 0, 0, 0)
524 actual = t.transform(points)
525 expected = np.array([[0, 0], [10, 0], [-1, 0]])
526 assert_almost_equal(actual, expected)
527
528 t = mtransforms.Affine2D.from_values(0, 2, 0, 0, 0, 0)
529 actual = t.transform(points)
530 expected = np.array([[0, 0], [0, 20], [0, -2]])
531 assert_almost_equal(actual, expected)
532
533 t = mtransforms.Affine2D.from_values(0, 0, 3, 0, 0, 0)
534 actual = t.transform(points)
535 expected = np.array([[0, 0], [60, 0], [0, 0]])
536 assert_almost_equal(actual, expected)
537
538 t = mtransforms.Affine2D.from_values(0, 0, 0, 4, 0, 0)
539 actual = t.transform(points)
540 expected = np.array([[0, 0], [0, 80], [0, 0]])
541 assert_almost_equal(actual, expected)
542
543 t = mtransforms.Affine2D.from_values(0, 0, 0, 0, 5, 0)
544 actual = t.transform(points)
545 expected = np.array([[5, 0], [5, 0], [5, 0]])
546 assert_almost_equal(actual, expected)
547
548 t = mtransforms.Affine2D.from_values(0, 0, 0, 0, 0, 6)
549 actual = t.transform(points)
550 expected = np.array([[0, 6], [0, 6], [0, 6]])
551 assert_almost_equal(actual, expected)
552
553
554def test_affine_inverted_invalidated():

Callers

nothing calls this directly

Calls 2

from_valuesMethod · 0.80
transformMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…