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

Method set_label_coords

lib/matplotlib/axis.py:761–779  ·  view source on GitHub ↗

Set the coordinates of the label. By default, the x coordinate of the y label and the y coordinate of the x label are determined by the tick label bounding boxes, but this can lead to poor alignment of multiple labels if there are multiple Axes. You can als

(self, x, y, transform=None)

Source from the content-addressed store, hash-verified

759 'ticker locations should be trimmed.'))
760
761 def set_label_coords(self, x, y, transform=None):
762 """
763 Set the coordinates of the label.
764
765 By default, the x coordinate of the y label and the y coordinate of the
766 x label are determined by the tick label bounding boxes, but this can
767 lead to poor alignment of multiple labels if there are multiple Axes.
768
769 You can also specify the coordinate system of the label with the
770 transform. If None, the default coordinate system will be the axes
771 coordinate system: (0, 0) is bottom left, (0.5, 0.5) is center, etc.
772 """
773 self._autolabelpos = False
774 if transform is None:
775 transform = self.axes.transAxes
776
777 self.label.set_transform(transform)
778 self.label.set_position((x, y))
779 self.stale = True
780
781 def get_transform(self):
782 """Return the transform used in the Axis' scale"""

Callers 1

Calls 2

set_transformMethod · 0.45
set_positionMethod · 0.45

Tested by

no test coverage detected