publiplots.set_axis_labels

publiplots.set_axis_labels(ax, xlabel=None, ylabel=None, title=None, fontsize=None, fontweight='normal')[source]

Set axis labels and title with consistent formatting.

Only labels that are explicitly provided are set; None values leave the existing label / title untouched.

Parameters:
  • ax (matplotlib.axes.Axes) – Axes to modify in place.

  • xlabel (str, optional) – X-axis label. None leaves it unchanged.

  • ylabel (str, optional) – Y-axis label. None leaves it unchanged.

  • title (str, optional) – Plot title. None leaves it unchanged.

  • fontsize (float, optional) – Font size (points) for labels and title. None uses the active rcParams.

  • fontweight (str, default 'normal') – Font weight — e.g. 'normal', 'bold', 'light'.

Examples

>>> pp.set_axis_labels(ax, xlabel='Time (s)', ylabel='Signal',
...                    title='Results')