FigRecipe (scitex-plt) - Reproducible Scientific Figures
FigRecipe is a framework for creating reproducible, style-editable scientific figures via YAML recipes. It wraps matplotlib with automatic recording, enabling figures to be reproduced, modified, and shared. Part of SciTeX.
FigRecipe separates data, style, and specification for fully reproducible scientific figures.
Getting Started
API Reference
- FigRecipe API Reference
- Usage
subplots()save()reproduce()load()compose()align_panels()distribute_panels()align_smart()gui()crop()info()validate()extract_data()save_bundle()load_bundle()reproduce_bundle()load_style()unload_style()list_presets()get_graph_preset()list_graph_presets()register_graph_preset()DiagramSchematic_get_sns()_get_version()_rebrand_text()- Core Functions
- Recording Classes
- Style Management
- Alignment Functions
- GUI Editor
- Diagram Class
Key Features
Automatic Recording: All matplotlib calls automatically recorded to YAML
Reproducibility: Recreate any figure from its recipe file
Style Editing: Change styles without regenerating data
Data Preservation: Plot data saved to CSV files
CSV Column Input: Reference CSV columns in declarative specs
Statistical Annotations: Add significance brackets with p-values
Multi-Panel Composition: Combine figures with fr.compose()
Schematic Diagrams: Box-and-arrow schematics with mm-based coordinates and 8 validation rules (R1–R8)
MCP Integration: AI agents can create figures via MCP server
47 Plot Types: All standard matplotlib plot types supported
Quick Example
Python API:
import figrecipe as fr
import numpy as np
# Create figure (auto-recording enabled)
fig, ax = fr.subplots()
# Standard matplotlib API
x = np.linspace(0, 10, 100)
ax.plot(x, np.sin(x), label="sin(x)")
ax.set_xlabel("X")
ax.set_ylabel("Y")
ax.legend()
# Save creates image + recipe + data CSVs
fr.save(fig, "my_plot.png")
CLI:
# Reproduce a figure from recipe
figrecipe reproduce my_plot.yaml -o reproduced.png
# Launch GUI editor
figrecipe gui my_plot.yaml
# Validate reproduction fidelity
figrecipe validate my_plot.yaml
MCP Server:
# Start MCP server for AI agent integration
figrecipe mcp start