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

Method clip_to_bbox

lib/matplotlib/path.py:1093–1105  ·  view source on GitHub ↗

Clip the path to the given bounding box. The path must be made up of one or more closed polygons. This algorithm will not behave correctly for unclosed paths. If *inside* is `True`, clip to the inside of the box, otherwise to the outside of the box.

(self, bbox, inside=True)

Source from the content-addressed store, hash-verified

1091 if hatchpattern is not None else None)
1092
1093 def clip_to_bbox(self, bbox, inside=True):
1094 """
1095 Clip the path to the given bounding box.
1096
1097 The path must be made up of one or more closed polygons. This
1098 algorithm will not behave correctly for unclosed paths.
1099
1100 If *inside* is `True`, clip to the inside of the box, otherwise
1101 to the outside of the box.
1102 """
1103 verts = _path.clip_path_to_rect(self, bbox, inside)
1104 paths = [Path(poly) for poly in verts]
1105 return self.make_compound_path(*paths)
1106
1107
1108def get_path_collection_extents(

Callers 2

test_clip_to_bboxFunction · 0.80

Calls 2

make_compound_pathMethod · 0.95
PathClass · 0.85

Tested by 2

test_clip_to_bboxFunction · 0.64