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 theplot.panel_styleoption.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_locoption.pad (None, float) – Distance to the corner in axes fraction, which defaults to the
plot.panel_padoption.text_kw – Extra parameters passed to
matplotlib.axes.Axes.text(), likefontsize. 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)"
Methods
get_label(index)Get the label of a given index, starting from 0