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

Method test_translate

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

Source from the content-addressed store, hash-verified

112 [[1, 2], [4.5, 3.75], [4, 1]])
113
114 def test_translate(self):
115 tx = Affine2D().translate(23, 0)
116 ty = Affine2D().translate(0, 42)
117 trans = Affine2D().translate(23, 42)
118 assert_array_equal((tx + ty).get_matrix(), trans.get_matrix())
119 assert_array_equal(trans.transform(self.single_point), [24, 43])
120 assert_array_equal(trans.transform(self.multiple_points),
121 [[23, 44], [26, 45], [27, 42]])
122
123 def test_rotate_plus_other(self):
124 trans = Affine2D().rotate_deg(90).rotate_deg_around(*self.pivot, 180)

Callers

nothing calls this directly

Calls 4

Affine2DClass · 0.90
translateMethod · 0.80
get_matrixMethod · 0.45
transformMethod · 0.45

Tested by

no test coverage detected