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

Method _recompute_transform

lib/matplotlib/patches.py:1745–1762  ·  view source on GitHub ↗

Notes ----- This cannot be called until after this has been added to an Axes, otherwise unit conversion will fail. This makes it very important to call the accessor method and not directly access the transformation member variable.

(self)

Source from the content-addressed store, hash-verified

1743 self._patch_transform = transforms.IdentityTransform()
1744
1745 def _recompute_transform(self):
1746 """
1747 Notes
1748 -----
1749 This cannot be called until after this has been added to an Axes,
1750 otherwise unit conversion will fail. This makes it very important to
1751 call the accessor method and not directly access the transformation
1752 member variable.
1753 """
1754 center = (self.convert_xunits(self._center[0]),
1755 self.convert_yunits(self._center[1]))
1756 width = self.convert_xunits(self._width)
1757 height = self.convert_yunits(self._height)
1758 self._patch_transform = transforms.Affine2D() \
1759 .scale(width * 0.5, height * 0.5 * self._aspect_ratio_correction) \
1760 .rotate_deg(self.angle) \
1761 .scale(1, 1 / self._aspect_ratio_correction) \
1762 .translate(*center)
1763
1764 def get_path(self):
1765 """Return the path of the ellipse."""

Callers 2

get_patch_transformMethod · 0.95
drawMethod · 0.45

Calls 5

convert_xunitsMethod · 0.80
convert_yunitsMethod · 0.80
translateMethod · 0.80
rotate_degMethod · 0.80
scaleMethod · 0.45

Tested by

no test coverage detected