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

Function _get_anchored_bbox

lib/matplotlib/offsetbox.py:1103–1112  ·  view source on GitHub ↗

Return the (x, y) position of the *bbox* anchored at the *parentbbox* with the *loc* code with the *borderpad* and padding *pad_x*, *pad_y*.

(loc, bbox, parentbbox, pad_x, pad_y)

Source from the content-addressed store, hash-verified

1101
1102
1103def _get_anchored_bbox(loc, bbox, parentbbox, pad_x, pad_y):
1104 """
1105 Return the (x, y) position of the *bbox* anchored at the *parentbbox* with
1106 the *loc* code with the *borderpad* and padding *pad_x*, *pad_y*.
1107 """
1108 # This is only called internally and *loc* should already have been
1109 # validated. If 0 (None), we just let ``bbox.anchored`` raise.
1110 c = [None, "NE", "NW", "SW", "SE", "E", "W", "E", "S", "N", "C"][loc]
1111 container = parentbbox.padded(-pad_x, -pad_y)
1112 return bbox.anchored(c, container=container).p0
1113
1114
1115class AnchoredText(AnchoredOffsetbox):

Callers 1

get_offsetMethod · 0.85

Calls 2

paddedMethod · 0.80
anchoredMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…