SciPilot Skills family. Scientific data visualization advisor — thinks first, plots second. SciPilot Skills 家族成员 — 科研数据可视化顾问,先思考后绘制。
A Claude Code / Codex / Cursor Skill that does two things in order: (1) profiles your data and recommends the right chart for the argument you want to make, (2) renders it at publication grade for Nature / Science / IEEE / Elsevier / PNAS / Chinese journals. Built on matplotlib + seaborn + SciencePlots (static) and plotly (interactive), with CJK font auto-configuration so Chinese text never renders as boxes.
科研工作者最大的画图痛点往往不是"不会用 matplotlib",而是"手上一堆数据,不知道该用什么图把结论讲清楚"。scipilot-figure-skill 是 SciPilot Skills 家族的第二个成员,专做这件事——
它的首要能力是【思考与判断】,其次才是【绘制】。
普通画图工具 scipilot-figure-skill
───────────── ─────────────────────
你说 "画柱状图" → 先 EDA:每列类型、样本量、分布、异常值、相关性
直接 plt.bar() 再问:"你想论证什么?组间差异?关系?趋势?"
按数据特征 + 论证目标查决策框架推荐图型
n=5 想画均值柱时主动拦截 → 改用 stripplot
维度 > 12 时建议拆图,不硬塞
最后才进入绘制 → 期刊规范 → 自检 → 导出
0. 理解任务 ── 这张图要论证什么?数据在哪?
↓
1. 剖析数据 ── profile_data.py:列类型/样本量/分布/异常/相关
↓
2. 选图 ── chart_selection.md:按数据形态+论证目标决策
↓ (主动拦截 → viz_pitfalls.md)
3. 查规范 ── journal_specs.md:栏宽/字号/DPI/字体
↓
4. 配环境 ── setup_style.py:期刊预设+CJK字体
↓
5. 绘制 ── plot_recipes.md:9 类图配方
↓
6. 自检闭环 ── 程序自检 visual_qa + AI 读图 visual_review.md(缺字/裁切/重叠/对齐→回改)
↓
7. 导出 ── export_figure.py:多格式+按最终尺寸+灰度预览
普通画图工具画完就结束——没人回看成图,于是中文方框、文字被裁、图例压数据、子图编号乱放,全留到投稿才暴露。v2.1 补上出图后的闭环:
绘制 → 渲染 PNG → 程序自检(缺字/裁切/重叠) + AI 读图(遮盖/子图对齐/灰度)
↓ 发现问题
回到对应步骤改图 → 重渲 → 再读,直到通过
visual_qa.audit_layout() 同时盯 warning + logging 两条通道拦截缺字乱码,并查文字越界裁切、刻度标签重叠。layout_tools.add_panel_labels(fig) 用统一 figure 坐标让 a/b/c/d 横竖成线,不再手摆易错位。setup_style 全模式默认修负号方框 + 自动配 CJK 字体,从源头少出乱码。详见 references/visual_review.md。
figsize=(3.5, 2.625) 直接定 Nature 单栏完整 15 条在 references/viz_pitfalls.md。
请帮我安装这个 Skill:https://github.com/Haojae/scipilot-figure-skill.git
或手动:
git clone https://github.com/Haojae/scipilot-figure-skill.git \
~/.claude/skills/scipilot-figure-skill
pip install -r ~/.claude/skills/scipilot-figure-skill/requirements.txt
SciencePlots / pypdf / kaleido 是可选增强,缺失时不影响运行。
setup_style(lang='zh') 按优先级查找:
Noto Sans CJK SC > Source Han Sans SC > SimHei > Microsoft YaHei
找不到任何 CJK 字体时抛出清晰的安装提示。中文期刊"宋体 + Times New Roman 数字"混排:传 serif_for_zh=True。
例 1:用户只丢一个 CSV
我有这份 results.csv,帮我画成论文图。
→ Skill 不会直接画。会先:
1. 问"你这份数据主要想说服读者相信什么?"
2. 跑 profile_data.py 输出剖析报告
3. 给出推荐图型 + 理由 + 备选
4. 用户确认后才进入绘制流程
例 2:用户指定的图型不合适
帮我画 3 组各 5 个样本的均值柱状图。
→ Skill 主动拦截:
n=5 太小,均值柱掩盖分布——审稿人很可能要求"show individual points"。 我建议改成 箱线 + stripplot 叠加每个点:5 个点直接可见。要按原方案画,还是改?
例 3:多面板组合
给我画 Figure 1:4 panel,分别是 PCA、loss、混淆矩阵、生存曲线。
Nature 双栏。
→ 各 panel 字号配色统一,子图标签 a/b/c/d 加粗左上,导出 PDF + 灰度预览。
例 4:带显著性标注
3 组数据画箱线 + 显著性。
→ 先确认 n、检验方法、是否多重校正;图注必须写清统计内容。
# 数据剖析(思考的起点)
python scripts/profile_data.py results.csv --group group --group condition
# 列可用 CJK 字体
python scripts/setup_style.py --list-fonts
# 演示导出
python scripts/export_figure.py demo --out ./test_demo
# 合规自检
python scripts/check_figure.py figs/*.pdf --min-dpi 300 --strict
| Skill | 状态 | 功能 |
|---|---|---|
| scipilot-cite-skill | v1.0.0 | 文献检索与引用插入 |
| scipilot-figure-skill | v2.1.0 (本仓库) | 可视化顾问 + 绘制 + 视觉自检闭环 |
| scipilot-polish-skill | 规划中 | 学术论文润色 |
| scipilot-review-skill | 规划中 | AI 模拟审稿 |
| scipilot-submit-skill | 规划中 | 投稿格式适配 |
| scipilot-read-skill | 规划中 | 论文阅读与翻译 |
MIT © 2026 Haojae
The hardest part of scientific plotting is rarely "I don't know matplotlib" — it's "I have data, I don't know which chart conveys my conclusion." scipilot-figure-skill is the second member of the SciPilot Skills family, built around this insight: think first, plot second.
Generic plotter scipilot-figure-skill
────────────── ──────────────────────
"plot a bar chart" → Profiles data first: types, n, distribution, outliers
plt.bar() Asks: "What argument do you want this figure to make?"
Decides chart type from data shape + intent
Refuses bad choices (n=5 mean bar → stripplot instead)
Suggests splitting figures when dimensions exceed 12
Only then renders → spec → audit → export
0. Understand — what does this figure argue? where is the data?
↓
1. Profile — profile_data.py: types / n / distribution / outliers / corr
↓
2. Select — chart_selection.md: decision framework by shape + intent
↓ (active interception → viz_pitfalls.md)
3. Spec — journal_specs.md: column width / font / DPI
↓
4. Style — setup_style.py: journal preset + CJK font config
↓
5. Plot — plot_recipes.md: 9 recipe families
↓
6. Self-check — visual_qa (program) + AI reads the PNG (visual_review.md): glyphs/clipping/overlap/alignment
↓
7. Export — export_figure.py: multi-format + final size + grayscale
Generic plotters stop at "saved" — nobody looks at the result, so CJK tofu boxes, clipped labels, legends covering data, and misaligned panel letters all survive to submission. v2.1 closes the loop after rendering:
plot → render PNG → program audit (glyphs/clipping/overlap) + AI reads image (occlusion/panel alignment/grayscale)
↓ issues found
go back, fix, re-render, re-read — until clean
visual_qa.audit_layout() traps missing-glyph warnings (both warnings and logging channels), text clipped off-canvas, and overlapping tick labels.layout_tools.add_panel_labels(fig) places a/b/c/d in unified figure coordinates so they align both ways.setup_style fixes the minus-sign box in all modes and auto-configures CJK fonts.See references/visual_review.md.
figsize=(3.5, 2.625) directlyFull 15 in references/viz_pitfalls.md.
Please install this Skill for me: https://github.com/Haojae/scipilot-figure-skill.git
Manual:
git clone https://github.com/Haojae/scipilot-figure-skill.git \
~/.claude/skills/scipilot-figure-skill
pip install -r ~/.claude/skills/scipilot-figure-skill/requirements.txt
Example 1: bare CSV
I have results.csv. Plot it for my paper.
The skill will: profile the data, ask what argument the figure should make, recommend a chart with rationale + alternatives, and only then plot.
Example 2: bad request, gentle refusal
Plot a bar chart of group means: 3 groups, 5 samples each.
The skill will reply:
With n=5 per group a mean bar chart hides the distribution and reviewers typically ask for individual data points. I recommend box plot + stripplot overlay — all five points are visible and the distribution is clear. Stick with bars, or switch?
Example 3: multi-panel composite
Figure 1, 4 panels: PCA, loss curves, confusion matrix, survival.
Nature double column.
Example 4: statistical comparison
3 groups, box plot with significance.
| Skill | Status | Purpose |
|---|---|---|
| scipilot-cite-skill | v1.0.0 | Reference discovery & insertion |
| scipilot-figure-skill | v2.1.0 (this repo) | Advisor + renderer + visual self-check loop |
| scipilot-polish-skill | Planned | Academic prose polishing |
| scipilot-review-skill | Planned | AI peer-review simulation |
| scipilot-submit-skill | Planned | Submission formatting |
| scipilot-read-skill | Planned | Paper reading & translation |
MIT © 2026 Haojae
matplotlib>=3.7
seaborn>=0.13
plotly>=5.18
pandas>=2.0
numpy>=1.24
scipy>=1.10
Pillow>=10.0
SciencePlots>=2.1 # optional
pypdf>=4.0 # optional
kaleido>=0.2.1 # optional
PyMuPDF>=1.23 # optional; only for visual_qa.render_preview() of saved PDFs
Python 3.9+ recommended.
$ claude mcp add scipilot-figure-skill \
-- python -m otcore.mcp_server <graph>