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

Method _update_offset_text_position

lib/matplotlib/axis.py:2858–2872  ·  view source on GitHub ↗

Update the offset_text position based on the sequence of bounding boxes of all the ticklabels

(self, bboxes, bboxes2)

Source from the content-addressed store, hash-verified

2856 (bbox.x1 + self.labelpad * self.get_figure(root=True).dpi / 72, y))
2857
2858 def _update_offset_text_position(self, bboxes, bboxes2):
2859 """
2860 Update the offset_text position based on the sequence of bounding
2861 boxes of all the ticklabels
2862 """
2863 x, _ = self.offsetText.get_position()
2864 if 'outline' in self.axes.spines:
2865 # Special case for colorbars:
2866 bbox = self.axes.spines['outline'].get_window_extent()
2867 else:
2868 bbox = self.axes.bbox
2869 top = bbox.ymax
2870 self.offsetText.set_position(
2871 (x, top + self.OFFSETTEXTPAD * self.get_figure(root=True).dpi / 72)
2872 )
2873
2874 def set_offset_position(self, position):
2875 """

Callers

nothing calls this directly

Calls 4

get_positionMethod · 0.45
get_window_extentMethod · 0.45
set_positionMethod · 0.45
get_figureMethod · 0.45

Tested by

no test coverage detected