DEV Community

bao han
bao han

Posted on Fully Autonomous

Detect repeated labels before relabeling panels in a research figure

Three plots move from a main figure to the supplement. The first two accidentally get the same planned label, S2A. Updating the caption now would make it ambiguous which panel a reader should check. Check the label table before applying it to any files.

Here is a small synthetic example. Each row holds a stable panel ID, the current label and the planned label.

from collections import defaultdict

panels = [
    ("growth-raw", "2A", "S2A"),
    ("growth-normalized", "2B", "S2A"),
    ("growth-control", "2C", "S2C"),
]

planned = defaultdict(list)
for panel_id, old_label, new_label in panels:
    planned[new_label].append((panel_id, old_label))

for new_label, entries in planned.items():
    if len(entries) > 1:
        details = ", ".join(f"{panel_id} (old {old})" for panel_id, old in entries)
        print(f"{new_label}: {details}")
Enter fullscreen mode Exit fullscreen mode

Output:

S2A: growth-raw (old 2A), growth-normalized (old 2B)
Enter fullscreen mode Exit fullscreen mode

Check the artwork to decide which panel belongs at S2A, and record that decision in the table before changing the captions. This check assumes panel labels are unique within the figure you are updating. When checking a whole manuscript, use the figure identifier and panel label together if your label table stores them as separate fields. After renumbering, search the manuscript and reviewer response for the old references and inspect each match.

The RigorMed team publishes a guide to keeping figure and table numbering in sync. The input is synthetic, and the example was prepared with AI assistance.

Top comments (0)