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

Class BboxTransformTo

lib/matplotlib/transforms.py:2627–2662  ·  view source on GitHub ↗

`BboxTransformTo` is a transformation that linearly transforms points from the unit bounding box to a given `Bbox`.

Source from the content-addressed store, hash-verified

2625
2626
2627class BboxTransformTo(Affine2DBase):
2628 """
2629 `BboxTransformTo` is a transformation that linearly transforms points from
2630 the unit bounding box to a given `Bbox`.
2631 """
2632
2633 is_separable = True
2634
2635 def __init__(self, boxout, **kwargs):
2636 """
2637 Create a new `BboxTransformTo` that linearly transforms
2638 points from the unit bounding box to *boxout*.
2639 """
2640 _api.check_isinstance(BboxBase, boxout=boxout)
2641
2642 super().__init__(**kwargs)
2643 self._boxout = boxout
2644 self.set_children(boxout)
2645 self._mtx = None
2646 self._inverted = None
2647
2648 __str__ = _make_str_method("_boxout")
2649
2650 def get_matrix(self):
2651 # docstring inherited
2652 if self._invalid:
2653 outl, outb, outw, outh = self._boxout.bounds
2654 if DEBUG and (outw == 0 or outh == 0):
2655 raise ValueError("Transforming to a singular bounding box.")
2656 self._mtx = np.array([[outw, 0.0, outl],
2657 [ 0.0, outh, outb],
2658 [ 0.0, 0.0, 1.0]],
2659 float)
2660 self._inverted = None
2661 self._invalid = 0
2662 return self._mtx
2663
2664
2665class BboxTransformFrom(Affine2DBase):

Callers 9

make_imageMethod · 0.90
set_bbox_to_anchorMethod · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
_get_xy_transformMethod · 0.85
get_transformMethod · 0.85

Calls 1

_make_str_methodFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…