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

Method _convert_mesh_to_paths

lib/matplotlib/collections.py:2420–2438  ·  view source on GitHub ↗

Convert a given mesh into a sequence of `.Path` objects. This function is primarily of use to implementers of backends that do not directly support quadmeshes.

(coordinates)

Source from the content-addressed store, hash-verified

2418
2419 @staticmethod
2420 def _convert_mesh_to_paths(coordinates):
2421 """
2422 Convert a given mesh into a sequence of `.Path` objects.
2423
2424 This function is primarily of use to implementers of backends that do
2425 not directly support quadmeshes.
2426 """
2427 if isinstance(coordinates, np.ma.MaskedArray):
2428 c = coordinates.data
2429 else:
2430 c = coordinates
2431 points = np.concatenate([
2432 c[:-1, :-1],
2433 c[:-1, 1:],
2434 c[1:, 1:],
2435 c[1:, :-1],
2436 c[:-1, :-1]
2437 ], axis=2).reshape((-1, 5, 2))
2438 return [mpath.Path(x) for x in points]
2439
2440 def _convert_mesh_to_triangles(self, coordinates):
2441 """

Callers 2

set_pathsMethod · 0.80
draw_quad_meshMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected