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

Method test_skew

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

Source from the content-addressed store, hash-verified

102 [[0, -4], [9, -6], [12, 0]])
103
104 def test_skew(self):
105 trans_rad = Affine2D().skew(np.pi / 8, np.pi / 12)
106 trans_deg = Affine2D().skew_deg(22.5, 15)
107 assert_array_equal(trans_rad.get_matrix(), trans_deg.get_matrix())
108 # Using ~atan(0.5), ~atan(0.25) produces roundish numbers on output.
109 trans = Affine2D().skew_deg(26.5650512, 14.0362435)
110 assert_array_almost_equal(trans.transform(self.single_point), [1.5, 1.25])
111 assert_array_almost_equal(trans.transform(self.multiple_points),
112 [[1, 2], [4.5, 3.75], [4, 1]])
113
114 def test_translate(self):
115 tx = Affine2D().translate(23, 0)

Callers

nothing calls this directly

Calls 5

Affine2DClass · 0.90
skewMethod · 0.80
skew_degMethod · 0.80
get_matrixMethod · 0.45
transformMethod · 0.45

Tested by

no test coverage detected