xoa.plot.PanelLabeler

xoa.plot.PanelLabeler#

class xoa.plot.PanelLabeler(style=None, start=0, loc=None, pad=None, **text_kw)[source]#

Label the panels of figures with letters or numbers, like “a)”

The counter goes on from one call to the next, so that the panels of several figures or of several groups of axes can share a single sequence.

Parameters:
  • style (None, str) – Format of the labels, where {a} is a lower case letter, {A} an upper case letter and {n} a number starting from 1. It defaults to the plot.panel_style option.

  • start (int) – Index of the first label, starting from 0.

  • loc (None, {"upper left", "upper right", "lower left", "lower right"}) – Corner of the axes where the labels are put, which defaults to the plot.panel_loc option.

  • pad (None, float) – Distance to the corner in axes fraction, which defaults to the plot.panel_pad option.

  • text_kw – Extra parameters passed to matplotlib.axes.Axes.text(), like fontsize. By default, the labels are bold and have a white halo.

Example

labeler = PanelLabeler("({A})")
labeler(axes[:2])
labeler(axes[2:])  # Goes on with "(C)"
__init__(style=None, start=0, loc=None, pad=None, **text_kw)[source]#

Methods

get_label(index)

Get the label of a given index, starting from 0