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

Method test_scale

lib/matplotlib/tests/test_transforms.py:95–102  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

93 assert_array_almost_equal((r90 + r180).get_matrix(), r270.get_matrix())
94
95 def test_scale(self):
96 sx = Affine2D().scale(3, 1)
97 sy = Affine2D().scale(1, -2)
98 trans = Affine2D().scale(3, -2)
99 assert_array_equal((sx + sy).get_matrix(), trans.get_matrix())
100 assert_array_equal(trans.transform(self.single_point), [3, -2])
101 assert_array_equal(trans.transform(self.multiple_points),
102 [[0, -4], [9, -6], [12, 0]])
103
104 def test_skew(self):
105 trans_rad = Affine2D().skew(np.pi / 8, np.pi / 12)

Callers

nothing calls this directly

Calls 4

Affine2DClass · 0.90
scaleMethod · 0.45
get_matrixMethod · 0.45
transformMethod · 0.45

Tested by

no test coverage detected