Make the transSubfigure bbox relative to Figure transform. Parameters ---------- bbox : bbox or None If not None, then the bbox is used for relative bounding box. Otherwise, it is calculated from the subplotspec.
(self, bbox=None)
| 2339 | return self._parent._get_renderer() |
| 2340 | |
| 2341 | def _redo_transform_rel_fig(self, bbox=None): |
| 2342 | """ |
| 2343 | Make the transSubfigure bbox relative to Figure transform. |
| 2344 | |
| 2345 | Parameters |
| 2346 | ---------- |
| 2347 | bbox : bbox or None |
| 2348 | If not None, then the bbox is used for relative bounding box. |
| 2349 | Otherwise, it is calculated from the subplotspec. |
| 2350 | """ |
| 2351 | if bbox is not None: |
| 2352 | self.bbox_relative.p0 = bbox.p0 |
| 2353 | self.bbox_relative.p1 = bbox.p1 |
| 2354 | return |
| 2355 | # need to figure out *where* this subplotspec is. |
| 2356 | gs = self._subplotspec.get_gridspec() |
| 2357 | wr = np.asarray(gs.get_width_ratios()) |
| 2358 | hr = np.asarray(gs.get_height_ratios()) |
| 2359 | dx = wr[self._subplotspec.colspan].sum() / wr.sum() |
| 2360 | dy = hr[self._subplotspec.rowspan].sum() / hr.sum() |
| 2361 | x0 = wr[:self._subplotspec.colspan.start].sum() / wr.sum() |
| 2362 | y0 = 1 - hr[:self._subplotspec.rowspan.stop].sum() / hr.sum() |
| 2363 | self.bbox_relative.p0 = (x0, y0) |
| 2364 | self.bbox_relative.p1 = (x0 + dx, y0 + dy) |
| 2365 | |
| 2366 | def get_constrained_layout(self): |
| 2367 | """ |
no test coverage detected