MCPcopy Create free account
hub / github.com/shapely/shapely / patch_from_polygon

Function patch_from_polygon

shapely/plotting.py:39–59  ·  view source on GitHub ↗

Get a Matplotlib patch from a (Multi)Polygon. Note: this function is experimental, and mainly targeting (interactive) exploration, debugging and illustration purposes. Parameters ---------- polygon : shapely.Polygon or shapely.MultiPolygon The polygon to convert to a Ma

(polygon, **kwargs)

Source from the content-addressed store, hash-verified

37
38
39def patch_from_polygon(polygon, **kwargs):
40 """Get a Matplotlib patch from a (Multi)Polygon.
41
42 Note: this function is experimental, and mainly targeting (interactive)
43 exploration, debugging and illustration purposes.
44
45 Parameters
46 ----------
47 polygon : shapely.Polygon or shapely.MultiPolygon
48 The polygon to convert to a Matplotlib Patch.
49 **kwargs
50 Additional keyword arguments passed to the matplotlib Patch.
51
52 Returns
53 -------
54 Matplotlib artist (PathPatch)
55
56 """
57 from matplotlib.patches import PathPatch
58
59 return PathPatch(_path_from_polygon(polygon), **kwargs)
60
61
62def plot_polygon(

Callers 4

test_patch_from_polygonFunction · 0.90
plot_polygonFunction · 0.85

Calls 1

_path_from_polygonFunction · 0.85

Tested by 3

test_patch_from_polygonFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…