/sci-figures:sci-figuresfrom sci-figures
Guidelines for Nature-style research figures (main, Extended Data, supplementary) and their legends: planning the message and outline, layout, visual conventions, colors, scale bars, export to one PDF per figure with editable Arial text, legend writing, and independent layout and legend reviews. Use whenever creating, restyling or assembling a paper figure or panel; or writing or revising a figure legend.
Ships in sci-figures. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You write the plotting code (matplotlib, seaborn, scanpy); this skill says what the result must achieve. The scifig package supplies only the style, a few recurring elements and the export.
Paths starting with references/ or examples/ are in this skill's folder; all others (resources/, scripts) are in the repository you are working in. <figures> is where that repository's analysis conventions put figures, figures/ if it has none.
| File | Covers |
|---|---|
references/style.md | visual conventions and panel layout |
references/legends.md | legend conventions |
references/review.md | the layout and legend reviews |
examples/ | two complete figures: outline, script, legend |
references/setup.md | installing scifig, Arial and TeX |
Agree the format: main, Extended Data or supplementary; width and approximate height (references/style.md, Page). Then iterate on an outline until the user approves it, and save it next to the figure script. When the user points at an earlier figure to build on, first list every block it has, from its code or PDF:
**Message:** <one sentence; becomes the legend title>
**Story line:** <how the panels build the message, in order>
**a** <panel name>
- Role: <what it adds to the story line>
- Shows: <data, subset, n>
- Plot: <plot type; x, y; color, size and other encodings>
- Shared: <axes, keys or marks shared with other panels, or "none">
- Source: <script or file producing the plotted data; "to be computed" if not yet>
Cut panels that don't advance the message. Resolve open questions (n, tests, subsets), then compute and save all plotted data.
Prefer scverse's plotting functions (scanpy, spatialdata-plot) where they apply, restyled with scifig; any deviation needs a reason, stated in the script.
Find the repo's colors (references/style.md, Color and marks) and the conventions of existing figure scripts; see examples/fig1_moscot.py (plots and a schematic) and examples/fig2_spatial.py (images and spatial data). The recurring elements:
import scanpy as sc # if used
import scifig as sf
sf.apply_style() # after importing scanpy; never sc.set_figure_params
fig = sf.new_figure(183, 120) # mm
ax = sf.add_axes_mm(fig, left, top, w, h) # mm from the top-left corner
sf.embedding_axes(ax) # UMAP1/UMAP2 arrows instead of a frame
sf.colorbar(mappable, cax, label="Expression") # labelled at its ends
sf.key(ax, {"Alpha": c1, "Beta": c2}, title="Cell type") # categorical key, right of ax; markers=, labels=, italic=
sf.scale_bar(ax, 100, "µm", data_unit_size=px_um)
sf.badge(ax, x, y, color, id="3") # an entity's mark
ax.legend(handles=[sf.badge_handle(color, id="3", label="Forebrain")]) # the same mark as a key entry
sf.panel_letter(fig, "a", left, top, title="...", over=ax) # title centered over ax
sf.ylabel(ax, "Accuracy", left) # left edge flush with the panel letter
sf.save(fig, FIGURES / "fig2_atlas", legend=FIGURES / "fig2_atlas_legend.md") # FIGURES: <figures>
If scifig, Arial or LaTeX (for equations) is missing, follow references/setup.md or tell the user.
Go through the layout review's checklist (references/review.md) yourself, on the preview and zoomed crops of its dense regions. Fix and repeat.
Write the legend following references/legends.md, from the plotting code, the data (compute n, never estimate it) and the discussion that led to the figure.
On a near-final draft, run both reviews in references/review.md in parallel; afterwards only when the user asks.
Whenever you show the user a figure (drafts included), show the figure file, not the preview, with its current legend in the same message. At the end, send the figure file and the legend file with the size and raster resolution sf.save prints, and list the review findings you declined, each with its reason.
<figures>/<name>.pdf, .svg or both (vector formats only), as the plugin setting figure_format says ("${user_config.figure_format}"), unless the user asks otherwise for a figure (sf.save(..., formats=("svg",))); named fig<N>_<topic> with figures numbered in reading order (fig1_overview ... figN_<topic>), so a discussion can name one: vector, with text as editable Arial, except images and dense marks: sf.save rasterizes every collection drawing more than 10,000 vertices (scatters of about 400 points or more, detailed outlines), whatever drew it. It writes rasters at 1200 dpi, lowered to no less than 300 dpi to keep the PDF within 5 MB. The SVG is for editing in Illustrator: its text names Arial without embedding it.<figures>/<name>_legend.md: the legend, next to the figure (sf.save(..., legend=) copies it there if it is kept elsewhere, e.g. next to the script).<figures>/.preview/<name>.png: for you and the reviewers only; never show or send it to the user.In Illustrator, each axes sits in a clipping mask (Object > Clipping Mask > Release); in the SVG, each panel is one group named after its letter ("panel a"). Changes made there are not reproduced by the script; limit them to what the script cannot do (e.g. illustrations) and tell the user which parts they are.
examples/fig1_moscot.py (opens in a new tab)examples/fig1_moscot_legend.md (opens in a new tab)examples/fig1_moscot_outline.md (opens in a new tab)examples/fig2_spatial.py (opens in a new tab)examples/fig2_spatial_data.py (opens in a new tab)examples/fig2_spatial_legend.md (opens in a new tab)examples/fig2_spatial_outline.md (opens in a new tab)examples/resources/figure_conventions.yaml (opens in a new tab)references/legends.md (opens in a new tab)references/review.md (opens in a new tab)references/setup.md (opens in a new tab)references/style.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
sci-figures@quadbio is listed by quadbio/claude-plugins — review the source before installing
npx claudepluginhub quadbio/claude-plugins --plugin sci-figures