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

Method _update_loc

lib/matplotlib/legend.py:83–91  ·  view source on GitHub ↗
(self, loc_in_canvas)

Source from the content-addressed store, hash-verified

81 self._update_bbox_to_anchor(self.get_loc_in_canvas())
82
83 def _update_loc(self, loc_in_canvas):
84 bbox = self.legend.get_bbox_to_anchor()
85 # if bbox has zero width or height, the transformation is
86 # ill-defined. Fall back to the default bbox_to_anchor.
87 if bbox.width == 0 or bbox.height == 0:
88 self.legend.set_bbox_to_anchor(None)
89 bbox = self.legend.get_bbox_to_anchor()
90 _bbox_transform = BboxTransformFrom(bbox)
91 self.legend._loc = tuple(_bbox_transform.transform(loc_in_canvas))
92
93 def _update_bbox_to_anchor(self, loc_in_canvas):
94 loc_in_bbox = self.legend.axes.transAxes.transform(loc_in_canvas)

Callers 1

finalize_offsetMethod · 0.95

Calls 4

BboxTransformFromClass · 0.90
get_bbox_to_anchorMethod · 0.45
set_bbox_to_anchorMethod · 0.45
transformMethod · 0.45

Tested by

no test coverage detected