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

Method set_label

lib/matplotlib/colorbar.py:977–1002  ·  view source on GitHub ↗

Add a label to the long axis of the colorbar. Parameters ---------- label : str The label text. loc : str, optional The location of the label. - For horizontal orientation one of {'left', 'center', 'right'} -

(self, label, *, loc=None, **kwargs)

Source from the content-addressed store, hash-verified

975 self.long_axis.set_minor_locator(self._minorlocator)
976
977 def set_label(self, label, *, loc=None, **kwargs):
978 """
979 Add a label to the long axis of the colorbar.
980
981 Parameters
982 ----------
983 label : str
984 The label text.
985 loc : str, optional
986 The location of the label.
987
988 - For horizontal orientation one of {'left', 'center', 'right'}
989 - For vertical orientation one of {'bottom', 'center', 'top'}
990
991 Defaults to :rc:`xaxis.labellocation` or :rc:`yaxis.labellocation`
992 depending on the orientation.
993 **kwargs
994 Keyword arguments are passed to `~.Axes.set_xlabel` /
995 `~.Axes.set_ylabel`.
996 Supported keywords are *labelpad* and `.Text` properties.
997 """
998 if self.orientation == "vertical":
999 self.ax.set_ylabel(label, loc=loc, **kwargs)
1000 else:
1001 self.ax.set_xlabel(label, loc=loc, **kwargs)
1002 self.stale = True
1003
1004 def set_alpha(self, alpha):
1005 """

Callers 1

__init__Method · 0.95

Calls 2

set_ylabelMethod · 0.80
set_xlabelMethod · 0.80

Tested by

no test coverage detected