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

Method _update_offset_text_position

lib/matplotlib/axis.py:2631–2653  ·  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

2629 (x, bbox.y1 + self.labelpad * self.get_figure(root=True).dpi / 72))
2630
2631 def _update_offset_text_position(self, bboxes, bboxes2):
2632 """
2633 Update the offset_text position based on the sequence of bounding
2634 boxes of all the ticklabels
2635 """
2636 x, y = self.offsetText.get_position()
2637 if not hasattr(self, '_tick_position'):
2638 self._tick_position = 'bottom'
2639 if self._tick_position == 'bottom':
2640 if not len(bboxes):
2641 bottom = self.axes.bbox.ymin
2642 else:
2643 bbox = mtransforms.Bbox.union(bboxes)
2644 bottom = bbox.y0
2645 y = bottom - self.OFFSETTEXTPAD * self.get_figure(root=True).dpi / 72
2646 else:
2647 if not len(bboxes2):
2648 top = self.axes.bbox.ymax
2649 else:
2650 bbox = mtransforms.Bbox.union(bboxes2)
2651 top = bbox.y1
2652 y = top + self.OFFSETTEXTPAD * self.get_figure(root=True).dpi / 72
2653 self.offsetText.set_position((x, y))
2654
2655 def set_ticks_position(self, position):
2656 """

Callers

nothing calls this directly

Calls 4

unionMethod · 0.80
get_positionMethod · 0.45
get_figureMethod · 0.45
set_positionMethod · 0.45

Tested by

no test coverage detected