(self)
| 322 | return self.get_datalim(transforms.IdentityTransform()) |
| 323 | |
| 324 | def _prepare_points(self): |
| 325 | # Helper for drawing and hit testing. |
| 326 | |
| 327 | transform = self.get_transform() |
| 328 | offset_trf = self.get_offset_transform() |
| 329 | offsets = self.get_offsets() |
| 330 | paths = self.get_paths() |
| 331 | |
| 332 | if self.have_units(): |
| 333 | paths = [] |
| 334 | for path in self.get_paths(): |
| 335 | vertices = path.vertices |
| 336 | xs, ys = vertices[:, 0], vertices[:, 1] |
| 337 | xs = self.convert_xunits(xs) |
| 338 | ys = self.convert_yunits(ys) |
| 339 | paths.append(mpath.Path(np.column_stack([xs, ys]), path.codes)) |
| 340 | xs = self.convert_xunits(offsets[:, 0]) |
| 341 | ys = self.convert_yunits(offsets[:, 1]) |
| 342 | offsets = np.ma.column_stack([xs, ys]) |
| 343 | |
| 344 | if not transform.is_affine: |
| 345 | paths = [transform.transform_path_non_affine(path) |
| 346 | for path in paths] |
| 347 | transform = transform.get_affine() |
| 348 | if not offset_trf.is_affine: |
| 349 | offsets = offset_trf.transform_non_affine(offsets) |
| 350 | # This might have changed an ndarray into a masked array. |
| 351 | offset_trf = offset_trf.get_affine() |
| 352 | |
| 353 | if isinstance(offsets, np.ma.MaskedArray): |
| 354 | offsets = offsets.filled(np.nan) |
| 355 | # Changing from a masked array to nan-filled ndarray |
| 356 | # is probably most efficient at this point. |
| 357 | |
| 358 | return transform, offset_trf, offsets, paths |
| 359 | |
| 360 | @artist.allow_rasterization |
| 361 | def draw(self, renderer): |
no test coverage detected