Get the position and the bbox for the Axes. Parameters ---------- ax : `~matplotlib.axes.Axes` renderer : `~matplotlib.backend_bases.RendererBase` subclass. Returns ------- pos : `~matplotlib.transforms.Bbox` Position in figure coordinates. bbox : `~mat
(ax, renderer)
| 615 | |
| 616 | |
| 617 | def get_pos_and_bbox(ax, renderer): |
| 618 | """ |
| 619 | Get the position and the bbox for the Axes. |
| 620 | |
| 621 | Parameters |
| 622 | ---------- |
| 623 | ax : `~matplotlib.axes.Axes` |
| 624 | renderer : `~matplotlib.backend_bases.RendererBase` subclass. |
| 625 | |
| 626 | Returns |
| 627 | ------- |
| 628 | pos : `~matplotlib.transforms.Bbox` |
| 629 | Position in figure coordinates. |
| 630 | bbox : `~matplotlib.transforms.Bbox` |
| 631 | Tight bounding box in figure coordinates. |
| 632 | """ |
| 633 | fig = ax.get_figure(root=False) |
| 634 | pos = ax.get_position(original=True) |
| 635 | # pos is in panel co-ords, but we need in figure for the layout |
| 636 | pos = pos.transformed(fig.transSubfigure - fig.transFigure) |
| 637 | tightbbox = martist._get_tightbbox_for_layout_only(ax, renderer) |
| 638 | if tightbbox is None: |
| 639 | bbox = pos |
| 640 | else: |
| 641 | bbox = tightbbox.transformed(fig.transFigure.inverted()) |
| 642 | return pos, bbox |
| 643 | |
| 644 | |
| 645 | def reposition_axes(layoutgrids, fig, renderer, *, |
no test coverage detected
searching dependent graphs…