First define what the figure is meant to prove, then decide what to draw. Journal-level figures are the joint product of evidence structure, visual hierarchy, data integrity, and reproducible export.
Routing
- Quantitative figures: use Python (matplotlib/seaborn) or R (ggplot2/patchwork/ComplexHeatmap).
- Mechanism diagrams or graphical abstracts: first build a list of concepts and relationships, then use vector tools or available image generation capabilities to produce a draft; AI images must not be used to replace quantitative evidence.
- Review of existing figures: inspect the figure source code, the final export, and the final layout dimensions at the same time; do not rely only on screen screenshots.
Prefer to follow the user's existing language and project stack. When the user has not specified and no project constraints exist, use Python by default and state this in the delivery; ask only when the choice would significantly affect reproducibility or collaboration.
Figure contract
Before plotting, write down:
Conclusion: the one sentence the reader should be able to restate after viewing the figure.Evidence hierarchy: primary evidence, supporting evidence, controls, and boundaries.Panel map: the task of each panel, its data, and its relationship to the other panels.Data contract: variables, units, independent samples, missingness, exclusions, and transformation rules.Statistics contract: estimators, error, tests, correction,nand pairing/repeated-measures structure.Export contract: column width, target dimensions, fonts, vector/raster, resolution, and source data.
Detailed template read references/figure-contract.md。
Execution workflow
- Audit the data. Retain input row counts, exclusion rules, transformations, and counts before and after aggregation; do not silently delete outliers or missing values.
- Choose the graphic. Choose the figure based on the scientific question, variable types, and experimental hierarchy, not on what "looks like a top journal". Read references/chart-selection.md。
- Plan the layout. Arrange the main panels and reading order first, then write the plotting code; the number of panels serves the argument, not filling the page.
- Code and export. Fix the random seed, fonts, dimensions, colors, ordering, and export parameters; retain runnable source code.
- Write the caption. State the sample,
n, central tendency, error, tests, correction, symbols, and abbreviations, so that the caption can be understood independently. - Automatic pre-check. Execute
python scripts/figure_preflight.py <source.py|source.R> --artifact <figure.svg> ...。 - Visual verification. At the final print size, check labels, legends, line widths, occlusion, color-blind distinguishability, panel consistency, and raster clarity after scaling.
- Deliver a traceability package. Provide source code, exported files, source data, parameter descriptions, exclusion records, and remaining risks.
Visual and export standards read references/visual-standards.md。
Default delivery
Figure contract
- Conclusion:
- Evidence hierarchy:
- Panel map:
- Data/statistics contract:
- Export contract:
Artifacts
- source:
- vector:
- raster:
- source data:
Integrity log
- input rows:
- exclusions:
- transformations:
- output rows:
Preflight and visual QA
- passed:
- warnings:
- author checks:
Quality thresholds
- The graphic type is consistent with the data structure, experimental unit, and statistical inference.
- Main figures should show the observed distribution or individual points as much as possible, rather than only bar heights and asterisks.
- Color is not used as the sole encoding; use a color-blind-distinguishable palette with stable semantics.
- Panel labels, fonts, line widths, units, and decimal precision are consistent.
- Vector text remains editable; photos or micrographs meet resolution requirements at the target size.
- All exclusions, smoothing, truncation, normalization, and aggregation are traceable.
- Figure captions and main text use the same
n, tests, errors, and comparison directions. - Mechanistic diagrams clearly distinguish proven relationships, speculative pathways, and visual metaphors.
Material routing
| Task | Read |
|---|---|
| Conclusions, evidence hierarchy, panels, data, and export contract | references/figure-contract.md |
| Select charts by variable and scientific question | references/chart-selection.md |
| Fonts, colors, dimensions, vector/raster, figure captions, and final QA | references/visual-standards.md |