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

Method _recompute_transform

lib/matplotlib/spines.py:117–133  ·  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

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'):

Callers 1

get_patch_transformMethod · 0.95

Calls 4

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

Tested by

no test coverage detected