Axes locator for `.Axes.inset_axes` and similarly positioned Axes. The locator is a callable object used in `.Axes.set_aspect` to compute the Axes location depending on the renderer.
| 95 | |
| 96 | |
| 97 | class _TransformedBoundsLocator: |
| 98 | """ |
| 99 | Axes locator for `.Axes.inset_axes` and similarly positioned Axes. |
| 100 | |
| 101 | The locator is a callable object used in `.Axes.set_aspect` to compute the |
| 102 | Axes location depending on the renderer. |
| 103 | """ |
| 104 | |
| 105 | def __init__(self, bounds, transform): |
| 106 | """ |
| 107 | *bounds* (a ``[l, b, w, h]`` rectangle) and *transform* together |
| 108 | specify the position of the inset Axes. |
| 109 | """ |
| 110 | self._bounds = bounds |
| 111 | self._transform = transform |
| 112 | |
| 113 | def __call__(self, ax, renderer): |
| 114 | # Subtracting transSubfigure will typically rely on inverted(), |
| 115 | # freezing the transform; thus, this needs to be delayed until draw |
| 116 | # time as transSubfigure may otherwise change after this is evaluated. |
| 117 | return mtransforms.TransformedBbox( |
| 118 | mtransforms.Bbox.from_bounds(*self._bounds), |
| 119 | self._transform - ax.get_figure(root=False).transSubfigure) |
| 120 | |
| 121 | |
| 122 | def _process_plot_format(fmt, *, ambiguous_fmt_datakey=False): |
no outgoing calls
no test coverage detected
searching dependent graphs…