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

Method _prepare_points

lib/matplotlib/collections.py:324–358  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers 3

drawMethod · 0.95
containsMethod · 0.95
_auto_legend_dataMethod · 0.80

Calls 10

get_offset_transformMethod · 0.95
get_offsetsMethod · 0.95
get_pathsMethod · 0.95
convert_xunitsMethod · 0.80
convert_yunitsMethod · 0.80
get_transformMethod · 0.45
have_unitsMethod · 0.45
get_affineMethod · 0.45
transform_non_affineMethod · 0.45

Tested by

no test coverage detected