set_labels#
- ColorBar.set_labels(cb_label=None, hist_label=None, **kwargs)#
Set the labels (and the label-style) for the colorbar (and the histogram).
For more details, see ColorBar.ax_cb.set_xlabel(..) and matplotlib’s .Text properties.
- Parameters:
cb_label (str or None) – The label of the colorbar. If None, the existing label is maintained. The default is None.
hist_label (str or None) – The label of the histogram. If None, the existing label is maintained. The default is None.
kwargs – Additional kwargs passed to Axes.set_xlabel to control the appearance of the label (e.g. color, fontsize, labelpad etc.).
Examples
Set both colorbar and histogram label in one go
>>> cb.set_labels("The parameter", "histogram count", fontsize=10, color="r")
Use different styles for the colorbar and histogram labels
>>> cb.set_labels(cb_label="The parameter", color="r", labelpad=10) >>> cb.set_labels(hist_label="histogram count", fontsize=6, color="k")