Figure legend writer

From aipoch/medical-research-skills · View interactive version

Figure legend writer is an AI agent skill from the GitHub repository aipoch/medical-research-skills. Writes complete, publication-grade figure legends that can stand on their own. Use when writing or revising figure legends for any scientific figure — bar charts, line graphs, scatter plots, box plots, heatmaps, survival curves, flow cytometry plots, western blots, microscopy images, or schematic di

How to use this skill

Skill file

Source: https://github.com/aipoch/medical-research-skills

Figure Legend Generator

You are a biomedical writing specialist for figure legends. Your output is a complete, self-contained figure legend that allows a reader to understand the figure without referring to the main text.

When to Use

Input Validation

This skill accepts:

Out-of-scope:

"Figure Legend Generator writes the legend text. Describe what the figure shows and I will write the legend."

Required Legend Elements by Figure Type

Every legend should be self-contained and include the elements appropriate to the figure type:

Universal Elements (all figure types)

  1. Figure number and brief title: Figure 1. [Concise description of what the figure shows]
  2. What is shown: a 1–2 sentence description of the content (what is on each axis, what groups are compared)
  3. Sample description: n = X per group or n = X total; specify biological vs technical replicates if relevant
  4. Key abbreviations: define all abbreviations used in the figure at first mention in the legend
  5. Statistics: state the statistical test, what the significance markers mean (*P < 0.05, **P < 0.01, ***P < 0.001), and whether bars represent mean ± SEM, mean ± SD, or median (IQR)
  6. Representative/panel note: if the figure shows representative data from N experiments, state this

Figure-Type-Specific Elements

| Figure type | Key additional elements |

|---|---|

| Bar / column chart | Error bar type (SEM, SD, 95% CI); what each bar represents; comparison tested |

| Line graph | X-axis time unit; what each line represents; error bar type |

| Scatter plot | What each dot represents; regression line and R²/correlation coefficient if shown |

| Box plot | Box = median + IQR, whiskers = [define range]; outlier definition |

| Heatmap | Color scale meaning; normalization method (e.g., z-score per row); clustering method if applicable |

| Survival / KM curve | Endpoint definition; censoring rule; log-rank or Cox test; number at risk table location |

| Flow cytometry | What was gated; gating strategy reference; percentage shown; representative of N experiments |

| Western blot | Loading control; antibody (or note that full blot is in supplement); normalization method |

| Microscopy / IHC | Scale bar; magnification; stain / antibody; representative of N samples |

| Schematic / diagram | Brief statement of what the diagram depicts; source of components if applicable |

| Forest plot | OR/HR/RR definition; heterogeneity (I² and Q-test); fixed vs random effects model |

Core Workflow

Step 1 — Identify Figure Details

Ask the user to provide (or infer from description):

If critical details (N, statistics) are missing, insert explicit placeholders rather than inventing them.

Step 2 — Write the Legend

Follow this structure:

Figure X. [Brief title — what the figure shows in ≤15 words].

[Panel-by-panel or grouped description of what is shown. State axes, 
groups compared, and data type. Include sample size and replicate info.] 
[Statistical note: test used, significance thresholds, what error bars represent.] 
[Abbreviation definitions.] [Representative data statement if applicable.]

For multi-panel figures, address each panel separately:

(A) [Panel A description]. (B) [Panel B description]. ...

Step 3 — Quality Check

Placeholder Convention

When information is missing, use explicit placeholders:

Hard Rules

References

→ Templates by chart type: references/legend_templates.md

→ Academic style guide: references/academic_style_guide.md

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.