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

Method _get_bbox_and_child_offsets

lib/matplotlib/offsetbox.py:487–506  ·  view source on GitHub ↗
(self, renderer)

Source from the content-addressed store, hash-verified

485 """
486
487 def _get_bbox_and_child_offsets(self, renderer):
488 # docstring inherited
489 dpicor = renderer.points_to_pixels(1.)
490 pad = self.pad * dpicor
491 sep = self.sep * dpicor
492
493 bboxes = [c.get_bbox(renderer) for c in self.get_visible_children()]
494 if not bboxes:
495 return Bbox.from_bounds(0, 0, 0, 0).padded(pad), []
496
497 (y0, y1), yoffsets = _get_aligned_offsets(
498 [bbox.intervaly for bbox in bboxes], self.height, self.align)
499 width, xoffsets = _get_packed_offsets(
500 [bbox.width for bbox in bboxes], self.width, sep, self.mode)
501
502 x0 = bboxes[0].x0
503 xoffsets -= ([bbox.x0 for bbox in bboxes] - x0)
504
505 return (Bbox.from_bounds(x0, y0, width, y1 - y0).padded(pad),
506 [*zip(xoffsets, yoffsets)])
507
508
509class PaddedBox(OffsetBox):

Callers

nothing calls this directly

Calls 7

_get_aligned_offsetsFunction · 0.85
_get_packed_offsetsFunction · 0.85
get_visible_childrenMethod · 0.80
paddedMethod · 0.80
from_boundsMethod · 0.80
points_to_pixelsMethod · 0.45
get_bboxMethod · 0.45

Tested by

no test coverage detected