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

Method get_points

lib/matplotlib/transforms.py:1160–1188  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1158 __str__ = _make_str_method("_bbox", "_transform")
1159
1160 def get_points(self):
1161 # docstring inherited
1162 if self._invalid:
1163 p = self._bbox.get_points()
1164 # Transform all four points, then make a new bounding box
1165 # from the result, taking care to make the orientation the
1166 # same.
1167 points = self._transform.transform(
1168 [[p[0, 0], p[0, 1]],
1169 [p[1, 0], p[0, 1]],
1170 [p[0, 0], p[1, 1]],
1171 [p[1, 0], p[1, 1]]])
1172 points = np.ma.filled(points, 0.0)
1173
1174 xs = min(points[:, 0]), max(points[:, 0])
1175 if p[0, 0] > p[1, 0]:
1176 xs = xs[::-1]
1177
1178 ys = min(points[:, 1]), max(points[:, 1])
1179 if p[0, 1] > p[1, 1]:
1180 ys = ys[::-1]
1181
1182 self._points = np.array([
1183 [xs[0], ys[0]],
1184 [xs[1], ys[1]]
1185 ])
1186
1187 self._invalid = 0
1188 return self._points
1189
1190 if DEBUG:
1191 _get_points = get_points

Callers

nothing calls this directly

Calls 3

_checkMethod · 0.80
get_pointsMethod · 0.45
transformMethod · 0.45

Tested by

no test coverage detected