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

Method rotate_deg_around

lib/matplotlib/transforms.py:2075–2085  ·  view source on GitHub ↗

Add a rotation (in degrees) around the point (x, y) in place. Returns *self*, so this method can easily be chained with more calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate` and :meth:`scale`.

(self, x, y, degrees)

Source from the content-addressed store, hash-verified

2073 return self.translate(-x, -y).rotate(theta).translate(x, y)
2074
2075 def rotate_deg_around(self, x, y, degrees):
2076 """
2077 Add a rotation (in degrees) around the point (x, y) in place.
2078
2079 Returns *self*, so this method can easily be chained with more
2080 calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
2081 and :meth:`scale`.
2082 """
2083 # Cast to float to avoid wraparound issues with uint8's
2084 x, y = float(x), float(y)
2085 return self.translate(-x, -y).rotate_deg(degrees).translate(x, y)
2086
2087 def translate(self, tx, ty):
2088 """

Callers 7

_get_bracketMethod · 0.80
test_rotate_aroundMethod · 0.80
test_scale_plus_otherMethod · 0.80
test_skew_plus_otherMethod · 0.80

Calls 2

translateMethod · 0.95
rotate_degMethod · 0.80

Tested by 6

test_rotate_aroundMethod · 0.64
test_scale_plus_otherMethod · 0.64
test_skew_plus_otherMethod · 0.64