with one click
paper-figure
为数模竞赛论文生成出版级图表。当用户说'画图'、'作图'、'generate figures'、'论文图表'时使用。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
为数模竞赛论文生成出版级图表。当用户说'画图'、'作图'、'generate figures'、'论文图表'时使用。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
数据清洗、EDA、缺失值处理、异常值检测、相关性分析。触发词: 数据预处理、数据清洗、EDA、缺失值、异常值、data preprocessing、数据探索。
模型验证:交叉验证、留出法、残差分析、与已知解对比、假设检验。触发词: 模型验证、交叉验证、残差分析、model validation、留出法、误差分析、假设检验。
多子问题拆解与依赖分析。触发词: 子问题拆解、拆题、problem decomposition、依赖关系、求解顺序、时间分配、并行安排。
灵敏度分析:参数扰动、单因素/多因素分析、Monte Carlo 模拟、龙卷风图/蛛网图。触发词: 灵敏度分析、参数敏感性、sensitivity analysis、Monte Carlo、鲁棒性测试、参数扰动。
自动多轮评审优化循环。通过 Codex MCP 反复评审→修改→重新评审,直到达标或达到最大轮数。当用户说'自动优化循环'、'auto optimize'、'评审到通过'时使用。
Autonomously improve a generated paper via GPT-5.4 xhigh review → implement fixes → recompile, for 2 rounds. Use when user says "改论文", "improve paper", "论文润色循环", "auto improve", or wants to iteratively polish a generated paper.
| name | paper-figure |
| description | 为数模竞赛论文生成出版级图表。当用户说'画图'、'作图'、'generate figures'、'论文图表'时使用。 |
| argument-hint | ["figure-plan-or-data-path"] |
| allowed-tools | Bash(*), Read, Write, Edit, Grep, Glob, Agent, mcp__codex__codex, mcp__codex__codex-reply |
Generate all figures and tables for a paper based on: $ARGUMENTS
| Category | Can auto-generate? | Examples |
|---|---|---|
| Data-driven plots | ✅ Yes | Line plots (求解过程曲线), bar charts (method comparison), scatter plots, heatmaps, box/violin plots |
| Comparison tables | ✅ Yes | LaTeX tables comparing prior bounds, method features, 灵敏度分析 results |
| Multi-panel figures | ✅ Yes | Subfigure grids combining multiple plots (e.g., 3×3 dataset × method) |
| Architecture/pipeline diagrams | ❌ No — manual | Model architecture, data flow diagrams, system overviews. At best can generate a rough TikZ skeleton, but expect to draw these yourself using tools like draw.io, Figma, or TikZ |
| Generated image grids | ❌ No — manual | Grids of generated samples (e.g., GAN/diffusion outputs). These come from running your model, not from this skill |
| Photographs / screenshots | ❌ No — manual | Real-world images, UI screenshots, qualitative examples |
In practice: For a typical ML paper, this skill handles ~60% of figures (all data plots + tables). The remaining ~40% (hero figure, architecture diagram, qualitative results) need to be created manually and placed in figures/ before running /paper-write. The skill will detect these as "existing figures" and preserve them.
publication — Visual style preset. Options: publication (default, clean for print), poster (larger fonts), slide (bold colors)pdf — Output format. Options: pdf (vector, best for LaTeX), png (raster fallback)tab10 — Default matplotlib color cycle. Options: tab10, Set2, colorblind (deuteranopia-safe)figures/ — Output directory for generated figuresgpt-5.4 — Model used via Codex MCP for figure quality review./paper-plan)figures/ or project rootIf no PAPER_PLAN.md exists, scan for data files and ask the user which figures to generate.
Parse the Figure Plan table from PAPER_PLAN.md:
| ID | Type | Description | Data Source | Priority |
|----|------|-------------|-------------|----------|
| Fig 1 | Architecture | ... | manual | HIGH |
| Fig 2 | Line plot | ... | figures/exp.json | HIGH |
Identify:
Create a shared style configuration script:
# paper_plot_style.py — shared across all figure scripts
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams.update({
'font.size': FONT_SIZE,
'font.family': 'serif',
'font.serif': ['Times New Roman', 'Times', 'DejaVu Serif'],
'axes.labelsize': FONT_SIZE,
'axes.titlesize': FONT_SIZE + 1,
'xtick.labelsize': FONT_SIZE - 1,
'ytick.labelsize': FONT_SIZE - 1,
'legend.fontsize': FONT_SIZE - 1,
'figure.dpi': DPI,
'savefig.dpi': DPI,
'savefig.bbox': 'tight',
'savefig.pad_inches': 0.05,
'axes.grid': False,
'axes.spines.top': False,
'axes.spines.right': False,
'text.usetex': False, # set True if LaTeX is available
'mathtext.fontset': 'stix',
})
# Color palette
COLORS = plt.cm.tab10.colors # or Set2, or colorblind-safe
def save_fig(fig, name, fmt=FORMAT):
"""Save figure to FIG_DIR with consistent naming."""
fig.savefig(f'{FIG_DIR}/{name}.{fmt}')
print(f'Saved: {FIG_DIR}/{name}.{fmt}')
Use this decision tree for data-driven figures (inspired by Imbad0202/academic-research-skills):
| Data Pattern | Recommended Type | Size |
|---|---|---|
| X=time/steps, Y=metric | Line plot | 0.48\textwidth |
| Methods × 1 metric | Bar chart | 0.48\textwidth |
| Methods × multiple metrics | Grouped bar / radar | 0.95\textwidth |
| Two continuous variables | Scatter plot | 0.48\textwidth |
| Matrix / grid values | Heatmap | 0.48\textwidth |
| Distribution comparison | Box/violin plot | 0.48\textwidth |
| Multi-dataset results | Multi-panel (subfigure) | 0.95\textwidth |
| Prior work comparison | LaTeX table | — |
For each figure in the plan, create a standalone Python script:
Line plots (求解过程曲线, scaling):
# gen_fig2_training_curves.py
from paper_plot_style import *
import json
with open('figures/exp_results.json') as f:
data = json.load(f)
fig, ax = plt.subplots(1, 1, figsize=(5, 3.5))
ax.plot(data['steps'], data['fac_loss'], label='Factorized', color=COLORS[0])
ax.plot(data['steps'], data['crf_loss'], label='CRF-LR', color=COLORS[1])
ax.set_xlabel('Training Steps')
ax.set_ylabel('Cross-Entropy Loss')
ax.legend(frameon=False)
save_fig(fig, 'fig2_training_curves')
Bar charts (comparison, 灵敏度分析):
fig, ax = plt.subplots(1, 1, figsize=(5, 3))
methods = ['Baseline', 'Method A', 'Method B', 'Ours']
values = [82.3, 85.1, 86.7, 89.2]
bars = ax.bar(methods, values, color=[COLORS[i] for i in range(len(methods))])
ax.set_ylabel('Accuracy (%)')
# Add value labels on bars
for bar, val in zip(bars, values):
ax.text(bar.get_x() + bar.get_width()/2, bar.get_height() + 0.3,
f'{val:.1f}', ha='center', va='bottom', fontsize=FONT_SIZE-1)
save_fig(fig, 'fig3_comparison')
Comparison tables (LaTeX, for theory papers):
\begin{table}[t]
\centering
\caption{Comparison of estimation error bounds. $n$: sample size, $D$: ambient dim, $d$: latent dim, $K$: subspaces, $n_k$: modes.}
\label{tab:bounds}
\begin{tabular}{lccc}
\toprule
Method & Rate & Depends on $D$? & Multi-modal? \\
\midrule
\citet{MinimaxOkoAS23} & $n^{-s'/D}$ & Yes (curse) & No \\
\citet{ScoreMatchingdistributionrecovery} & $n^{-2/d}$ & No & No \\
\textbf{Ours} & $\sqrt{\sum n_k d_k / n}$ & No & Yes \\
\bottomrule
\end{tabular}
\end{table}
Architecture/pipeline diagrams (MANUAL — outside this skill's scope):
figures/, preserve it and generate only the LaTeX \includegraphics snippet[MANUAL] in the figure plan and latex_includes.tex# Run all figure generation scripts
for script in gen_fig*.py; do
python "$script"
done
Verify all output files exist and are non-empty.
For each figure, output the LaTeX code to include it:
% === Fig 2: Training Curves ===
\begin{figure}[t]
\centering
\includegraphics[width=0.48\textwidth]{figures/fig2_training_curves.pdf}
\caption{Training curves comparing factorized and CRF-LR denoising.}
\label{fig:training_curves}
\end{figure}
Save all snippets to figures/latex_includes.tex for easy copy-paste into the paper.
Send figure descriptions and captions to GPT-5.4 for review:
mcp__codex__codex:
model: gpt-5.4
config: {"model_reasoning_effort": "xhigh"}
prompt: |
Review these figure/table plans for a [VENUE] submission.
For each figure:
1. Is the caption informative and self-contained?
2. Does the figure type match the data being shown?
3. Is the comparison fair and clear?
4. Any missing baselines or 灵敏度分析s?
5. Would a different visualization be more effective?
[list all figures with captions and descriptions]
Before finishing, verify each figure (from pedrohcgs/claude-code-my-workflow):
\caption{} (from pedrohcgs)emp_rate)plt.title for publications)figures/
├── paper_plot_style.py # shared style config
├── gen_fig1_architecture.py # per-figure scripts
├── gen_fig2_training_curves.py
├── gen_fig3_comparison.py
├── fig1_architecture.pdf # generated figures
├── fig2_training_curves.pdf
├── fig3_comparison.pdf
├── latex_includes.tex # LaTeX snippets for all figures
└── TABLE_*.tex # standalone table LaTeX files
| Type | When to Use | Typical Size |
|---|---|---|
| Line plot | Training curves, scaling trends | 0.48\textwidth |
| Bar chart | Method comparison, 灵敏度分析 | 0.48\textwidth |
| Grouped bar | Multi-metric comparison | 0.95\textwidth |
| Scatter plot | Correlation analysis | 0.48\textwidth |
| Heatmap | Attention, 混淆矩阵 | 0.48\textwidth |
| Box/violin | Distribution comparison | 0.48\textwidth |
| Architecture | System overview | 0.95\textwidth |
| Multi-panel | Combined results (subfigures) | 0.95\textwidth |
| Comparison table | Prior bounds vs. ours (theory) | full width |
Design pattern (type × style matrix) inspired by baoyu-skills. Publication style defaults and figure rules from pedrohcgs/claude-code-my-workflow. Visualization decision tree from Imbad0202/academic-research-skills.