Figures¶
The figures plugin composes publication-quality figures at exact journal dimensions (Nature, Science, PNAS, Cell, and others) and QAs them before they go anywhere near a submission.
The figure pipeline¶
A figure moves through five steps, each with its own mechanical defense against the most common failure at that step, and a boomerang from validation straight back to building when a font fails:
- Plan: journal, size, panel grid, palette and theme
- Build:
plot-stylingfor data plots,svg-figure/svg-primitivesfor schematics, icons, or an AI-generated substrate - Compose:
svgutilsplaces panels at exact mm coordinates, with text preserved as inspectable<text>elements - Validate:
validate_fonts.pyreports the effective point size against the journal minimum - Export: Inkscape when available on
$PATH,cairosvgfallback otherwise
When the validator fails, the fix is mechanical: rescale the panel up, increase the source point size, or widen the canvas, not a redesign.
The plugin map¶
The plugin is a composer at the center, four element-builder skills that feed it, and a QA agent that runs on every figure regardless of how it was built:
How figure-qa decides what to check¶
figure-qa dispatches on input type, runs the matching deterministic check script, then always adds a VLM aesthetic pass on top:
- SVG →
check_svg.py(bbox / arrow-tip-to-target / point size / palette) - Raster (PNG/JPG/TIFF) →
check_raster.py(DPI / embedded fonts / alpha channel) - Plot script →
check_plot_script.py(savefigkwargs / rcParams) - Composed-figure directory → all of the above, per panel
Programmatic checks own anything with ground truth (font minima, palette compliance, geometry); the VLM judgment pass is reserved for "does this look balanced": hierarchy, alignment, palette coherence, journal fit.
Skills¶
- scientific-figure: the composer (the sink):
svgutils-based, exact mm coordinates,validate_fonts.pybefore export, Inkscape/cairosvg backend - plot-styling: data plots via matplotlib, seaborn, plotnine, plotly, or PyVista, with SciencePlots recipes for Nature/IEEE/Science/Cell/PNAS/APS
- svg-figure / svg-primitives: hand-authored or programmatic schematics: boxes, arrows, and labels in SVG, with
svg-primitivespreferred for new work (mm-precise, auto-fit text, tangent-correct arrows, in-process validation) - transparent-icons: flat scientific icons via the Codex CLI
image_gentool or the OpenAI Images API, with Pillow-threshold or opt-inrembg+BiRefNet transparency - ai-full-figure: an AI-generated pictorial substrate plus programmatic label/arrow/scale-bar overlay, so the model never hallucinates the labels themselves
- figure-qa: the QA agent described above, run against every figure regardless of how it was built
Try it¶
"Create a Nature 2-column figure with 3 panels showing EEG spectrograms"
"QA this figure for Science submission requirements"
"Generate a transparent icon of a neuron for my poster"
Learn more¶
The Agentic Research Course week 8, "Scientific Figures," covers this plugin hands-on.