r""" Get bounding box of a `.PathCollection`\s internal objects. That is, given a sequence of `Path`\s, `.Transform`\s objects, and offsets, as found in a `.PathCollection`, return the bounding box that encapsulates all of them. Parameters ---------- master_transform : `~ma
(
master_transform, paths, transforms, offsets, offset_transform)
| 1106 | |
| 1107 | |
| 1108 | def get_path_collection_extents( |
| 1109 | master_transform, paths, transforms, offsets, offset_transform): |
| 1110 | r""" |
| 1111 | Get bounding box of a `.PathCollection`\s internal objects. |
| 1112 | |
| 1113 | That is, given a sequence of `Path`\s, `.Transform`\s objects, and offsets, as found |
| 1114 | in a `.PathCollection`, return the bounding box that encapsulates all of them. |
| 1115 | |
| 1116 | Parameters |
| 1117 | ---------- |
| 1118 | master_transform : `~matplotlib.transforms.Transform` |
| 1119 | Global transformation applied to all paths. |
| 1120 | paths : list of `Path` |
| 1121 | transforms : list of `~matplotlib.transforms.Affine2DBase` |
| 1122 | If non-empty, this overrides *master_transform*. |
| 1123 | offsets : (N, 2) array-like |
| 1124 | offset_transform : `~matplotlib.transforms.Affine2DBase` |
| 1125 | Transform applied to the offsets before offsetting the path. |
| 1126 | |
| 1127 | Notes |
| 1128 | ----- |
| 1129 | The way that *paths*, *transforms* and *offsets* are combined follows the same |
| 1130 | method as for collections: each is iterated over independently, so if you have 3 |
| 1131 | paths (A, B, C), 2 transforms (α, β) and 1 offset (O), their combinations are as |
| 1132 | follows: |
| 1133 | |
| 1134 | - (A, α, O) |
| 1135 | - (B, β, O) |
| 1136 | - (C, α, O) |
| 1137 | """ |
| 1138 | from .transforms import Bbox |
| 1139 | if len(paths) == 0: |
| 1140 | raise ValueError("No paths provided") |
| 1141 | if len(offsets) == 0: |
| 1142 | raise ValueError("No offsets provided") |
| 1143 | extents, minpos = _path.get_path_collection_extents( |
| 1144 | master_transform, paths, np.atleast_3d(transforms), |
| 1145 | offsets, offset_transform) |
| 1146 | return Bbox.from_extents(*extents, minpos=minpos) |
nothing calls this directly
no test coverage detected
searching dependent graphs…