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)
| 115 | |
| 116 | # Behavior copied from mpatches.Ellipse: |
| 117 | def _recompute_transform(self): |
| 118 | """ |
| 119 | Notes |
| 120 | ----- |
| 121 | This cannot be called until after this has been added to an Axes, |
| 122 | otherwise unit conversion will fail. This makes it very important to |
| 123 | call the accessor method and not directly access the transformation |
| 124 | member variable. |
| 125 | """ |
| 126 | assert self._patch_type in ('arc', 'circle') |
| 127 | center = (self.convert_xunits(self._center[0]), |
| 128 | self.convert_yunits(self._center[1])) |
| 129 | width = self.convert_xunits(self._width) |
| 130 | height = self.convert_yunits(self._height) |
| 131 | self._patch_transform = mtransforms.Affine2D() \ |
| 132 | .scale(width * 0.5, height * 0.5) \ |
| 133 | .translate(*center) |
| 134 | |
| 135 | def get_patch_transform(self): |
| 136 | if self._patch_type in ('arc', 'circle'): |
no test coverage detected