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

Class _TransformedBoundsLocator

lib/matplotlib/axes/_base.py:97–119  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

95
96
97class _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
122def _process_plot_format(fmt, *, ambiguous_fmt_datakey=False):

Callers 3

inset_axesMethod · 0.90
set_locationMethod · 0.90
_make_twin_axesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…