create-figure
Generate publication-quality figures from code analysis data for academic papers.
Quick Start for Agents
Don't get overwhelmed by 50+ commands! Use domain navigation:
# Step 1: Find your domain
create-figure domains
# Step 2: List commands for your domain
create-figure list --domain ml # ML/LLM projects
create-figure list --domain control # Aerospace/control systems
create-figure list --domain bio # Bioinformatics
# Step 3: Or get recommendations by data type
create-figure recommend --data-type classification
create-figure recommend --data-type time_series
create-figure recommend --show-types # See all data types
Domain Quick Reference
| Domain |
Use For |
Key Commands |
| core |
Any project |
metrics, workflow, architecture, deps |
| ml |
ML/LLM evaluation |
confusion-matrix, roc-curve, training-curves, scaling-law |
| control |
Aerospace, control systems |
bode, nyquist, rootlocus, state-space |
| field |
Nuclear, thermal, physics |
contour, vector-field, heatmap |
| project |
Scheduling, requirements |
gantt, pert, radar, sankey |
| math |
Pure mathematics |
3d-surface, complex-plane, phase-portrait |
| bio |
Bioinformatics, medical |
violin, volcano, survival-curve, manhattan |
| hierarchy |
Breakdowns, fault trees |
treemap, sunburst, force-graph |
Architecture
Multi-backend design for maximum compatibility:
| Backend |
Use Case |
Output Formats |
| Graphviz |
Deterministic layouts, CI-friendly |
PDF, PNG, SVG, DOT |
| Mermaid |
Quick documentation, GitHub-compatible |
PDF, PNG, SVG, MMD |
| NetworkX |
Graph manipulation, D3 export |
JSON, PDF, PNG |
| matplotlib/seaborn |
Publication charts (IEEE settings) |
PDF, PNG, SVG |
| plotly |
Interactive Sankey, sunburst, treemap |
PDF, PNG, HTML |
| pydeps |
Python module dependencies |
via Graphviz |
| pyreverse |
UML class diagrams |
via Graphviz |
Common Commands
deps - Dependency Graph
./run.sh deps --project /path/to/package --output deps.pdf
./run.sh deps -p ./src -o deps.svg --backend mermaid --depth 3
architecture - Architecture Diagram
./run.sh architecture --project ./assess_output.json --output arch.pdf
metrics - Metrics Chart
./run.sh metrics --input data.json --output metrics.pdf --type bar
./run.sh metrics -i data.json -o chart.pdf --type pie --title "Issue Distribution"
Chart types: bar, hbar, pie, line
workflow - Workflow Diagram
./run.sh workflow --stages "Scope,Analysis,Search,Learn,Draft" --output workflow.pdf
confusion-matrix - Confusion Matrix
./run.sh confusion-matrix --input results.json --output confusion.pdf --normalize
roc-curve - ROC Curve
./run.sh roc-curve --input roc_data.json --output roc.pdf
bode - Bode Plot
./run.sh bode --num 1,2 --den 1,3,2 --output bode.pdf
heatmap - Heatmap
./run.sh heatmap --input matrix.json --output flux.pdf --cmap plasma
sankey - Sankey Diagram
./run.sh sankey --input flows.json --output sankey.pdf
from-assess - Generate All Figures
Generate all figures from /assess output in one command:
./run.sh from-assess --input assess_output.json --output-dir ./figures/
Generates:
architecture.pdf - System architecture diagram
dependencies.pdf - Module dependency graph
features.pdf - Feature distribution chart
issues.pdf - Issue severity pie chart
Publication Quality Settings
matplotlib figures use IEEE publication settings:
- Font: 8pt Times New Roman (serif)
- DPI: 600 for saving, 300 for display
- Column widths: Single (3.5"), Double (7.16")
- TrueType fonts for Illustrator compatibility
Dependencies
Required:
Optional (enables features):
| Package |
Features Enabled |
| matplotlib |
All charts, plots, diagrams |
| seaborn |
Heatmaps, publication styling |
| plotly |
Sankey, sunburst, treemap, interactive |
| networkx |
Force-directed graphs, PERT |
| scipy |
Bode/Nyquist fallback, contours |
| control |
Bode, Nyquist, root locus |
| graphviz |
Dependency/architecture diagrams |
Installation
# Core
pip install typer numpy matplotlib
# Full installation (all features)
pip install typer numpy matplotlib seaborn plotly networkx pandas squarify scipy control pydeps pylint
# System dependencies
apt install graphviz # Debian/Ubuntu
npm install -g @mermaid-js/mermaid-cli
1---2name: create-figure3description: Create publication-quality figures, charts, and diagrams. Multi-backend: Graphviz, Mermaid, NetworkX/D3, matplotlib, plotly, seaborn. 50+ visualization types for any domain.4---5
6# create-figure
7
8Generate publication-quality figures from code analysis data for academic papers.
9
10## Quick Start for Agents
11
12**Don't get overwhelmed by 50+ commands!** Use domain navigation:
13
14```bash
15# Step 1: Find your domain
16create-figure domains
17
18# Step 2: List commands for your domain
19create-figure list --domain ml # ML/LLM projects
20create-figure list --domain control # Aerospace/control systems
21create-figure list --domain bio # Bioinformatics
22
23# Step 3: Or get recommendations by data type
24create-figure recommend --data-type classification
25create-figure recommend --data-type time_series
26create-figure recommend --show-types # See all data types
27```
28
29### Domain Quick Reference
30
31| Domain | Use For | Key Commands |
32|--------|---------|--------------|
33| **core** | Any project | `metrics`, `workflow`, `architecture`, `deps` |
34| **ml** | ML/LLM evaluation | `confusion-matrix`, `roc-curve`, `training-curves`, `scaling-law` |
35| **control** | Aerospace, control systems | `bode`, `nyquist`, `rootlocus`, `state-space` |
36| **field** | Nuclear, thermal, physics | `contour`, `vector-field`, `heatmap` |
37| **project** | Scheduling, requirements | `gantt`, `pert`, `radar`, `sankey` |
38| **math** | Pure mathematics | `3d-surface`, `complex-plane`, `phase-portrait` |
39| **bio** | Bioinformatics, medical | `violin`, `volcano`, `survival-curve`, `manhattan` |
40| **hierarchy** | Breakdowns, fault trees | `treemap`, `sunburst`, `force-graph` |
41
42---
43
44## Architecture
45
46Multi-backend design for maximum compatibility:
47
48| Backend | Use Case | Output Formats |
49|---------|----------|----------------|
50| **Graphviz** | Deterministic layouts, CI-friendly | PDF, PNG, SVG, DOT |
51| **Mermaid** | Quick documentation, GitHub-compatible | PDF, PNG, SVG, MMD |
52| **NetworkX** | Graph manipulation, D3 export | JSON, PDF, PNG |
53| **matplotlib/seaborn** | Publication charts (IEEE settings) | PDF, PNG, SVG |
54| **plotly** | Interactive Sankey, sunburst, treemap | PDF, PNG, HTML |
55| **pydeps** | Python module dependencies | via Graphviz |
56| **pyreverse** | UML class diagrams | via Graphviz |
57
58## Common Commands
59
60### `deps` - Dependency Graph
61
62```bash
63./run.sh deps --project /path/to/package --output deps.pdf
64./run.sh deps -p ./src -o deps.svg --backend mermaid --depth 3
65```
66
67### `architecture` - Architecture Diagram
68
69```bash
70./run.sh architecture --project ./assess_output.json --output arch.pdf
71```
72
73### `metrics` - Metrics Chart
74
75```bash
76./run.sh metrics --input data.json --output metrics.pdf --type bar
77./run.sh metrics -i data.json -o chart.pdf --type pie --title "Issue Distribution"
78```
79
80Chart types: `bar`, `hbar`, `pie`, `line`
81
82### `workflow` - Workflow Diagram
83
84```bash
85./run.sh workflow --stages "Scope,Analysis,Search,Learn,Draft" --output workflow.pdf
86```
87
88### `confusion-matrix` - Confusion Matrix
89
90```bash
91./run.sh confusion-matrix --input results.json --output confusion.pdf --normalize
92```
93
94### `roc-curve` - ROC Curve
95
96```bash
97./run.sh roc-curve --input roc_data.json --output roc.pdf
98```
99
100### `bode` - Bode Plot
101
102```bash
103./run.sh bode --num 1,2 --den 1,3,2 --output bode.pdf
104```
105
106### `heatmap` - Heatmap
107
108```bash
109./run.sh heatmap --input matrix.json --output flux.pdf --cmap plasma
110```
111
112### `sankey` - Sankey Diagram
113
114```bash
115./run.sh sankey --input flows.json --output sankey.pdf
116```
117
118### `from-assess` - Generate All Figures
119
120Generate all figures from /assess output in one command:
121
122```bash
123./run.sh from-assess --input assess_output.json --output-dir ./figures/
124```
125
126Generates:
127- `architecture.pdf` - System architecture diagram
128- `dependencies.pdf` - Module dependency graph
129- `features.pdf` - Feature distribution chart
130- `issues.pdf` - Issue severity pie chart
131
132## Publication Quality Settings
133
134matplotlib figures use IEEE publication settings:
135- Font: 8pt Times New Roman (serif)
136- DPI: 600 for saving, 300 for display
137- Column widths: Single (3.5"), Double (7.16")
138- TrueType fonts for Illustrator compatibility
139
140## Dependencies
141
142**Required:**
143- Python 3.10+
144- typer
145- numpy
146
147**Optional (enables features):**
148
149| Package | Features Enabled |
150|---------|------------------|
151| matplotlib | All charts, plots, diagrams |
152| seaborn | Heatmaps, publication styling |
153| plotly | Sankey, sunburst, treemap, interactive |
154| networkx | Force-directed graphs, PERT |
155| scipy | Bode/Nyquist fallback, contours |
156| control | Bode, Nyquist, root locus |
157| graphviz | Dependency/architecture diagrams |
158
159## Installation
160
161```bash
162# Core
163pip install typer numpy matplotlib
164
165# Full installation (all features)
166pip install typer numpy matplotlib seaborn plotly networkx pandas squarify scipy control pydeps pylint
167
168# System dependencies
169apt install graphviz # Debian/Ubuntu
170npm install -g @mermaid-js/mermaid-cli
171```