torchcell.utils.panel_label

panel_label(ax: Axes, letter: str, x: float | None = None, y: float = 1.0, pad_pt: float = 1.5, raise_pt: float = 12.0, fontsize: float = 8.0) → Text[source]

Draw a panel letter at the panel’s top-left corner, in the repo standard.

Nature’s band for figure text is 5 to 7 pt, with 8 pt bold lowercase reserved for panel letters. The letter sits OUTSIDE the axes box, at the top-left of the PANEL – its left edge flush with the outermost y-axis decoration (the y label, or the tick labels when there is no y label) – and carries an opaque white patch, so the letter survives being cropped out of a composed figure with whatever sits behind it.

Placement follows the white-cross rule ([[paper.nature-biotech.style-guide]]): a cross the width of the letter box laid over the letter meets no title, spine, tick label, or axis label. The letter is raised raise_pt points above the axes top edge (one text line above the title band, clear of the topmost tick label) and pushed left to the panel’s outer edge, which is measured from the axes’ tight bounding box, so call this AFTER the y label and tick formatting are set. x (axes fraction) overrides the measured left edge; pad_pt is then the offset left of that anchor.