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

Method set_alignment

lib/matplotlib/axes/_secondary_axes.py:61–78  ·  view source on GitHub ↗

Set if axes spine and labels are drawn at top or bottom (or left/right) of the Axes. Parameters ---------- align : {'top', 'bottom', 'left', 'right'} Either 'top' or 'bottom' for orientation='x' or 'left' or 'right' for orientation='y

(self, align)

Source from the content-addressed store, hash-verified

59 self.set_alignment(self._locstrings[0])
60
61 def set_alignment(self, align):
62 """
63 Set if axes spine and labels are drawn at top or bottom (or left/right)
64 of the Axes.
65
66 Parameters
67 ----------
68 align : {'top', 'bottom', 'left', 'right'}
69 Either 'top' or 'bottom' for orientation='x' or
70 'left' or 'right' for orientation='y' axis.
71 """
72 _api.check_in_list(self._locstrings, align=align)
73 if align == self._locstrings[1]: # Need to change the orientation.
74 self._locstrings = self._locstrings[::-1]
75 self.spines[self._locstrings[0]].set_visible(True)
76 self.spines[self._locstrings[1]].set_visible(False)
77 self._axis.set_ticks_position(align)
78 self._axis.set_label_position(align)
79
80 def set_location(self, location, transform=None):
81 """

Callers 2

__init__Method · 0.95

Calls 3

set_visibleMethod · 0.45
set_ticks_positionMethod · 0.45
set_label_positionMethod · 0.45

Tested by 1