Scientific Figure 标志

Scientific Figure

社区
neuromechanist
scientific-figure

This skill should be used when the user asks to "create a figure", "make a scientific figure", "create a paper figure", "make a figure for my paper", "make a figure for my manuscript", "compose figure panels", "assemble figure panels", "combine figure panels", "make a multi-panel figure", "figure composition", "export a figure", "generate a PDF figure", "create a Nature-style figure", "make a journal figure", "make a publication figure", or "create a figure for my grant". The skill composes multi-panel figures at exact journal dimensions (Nature 89/183 mm, Science 55/120 mm, Cell 85/174 mm, PNAS 87/180 mm) using svgutils, validates font sizes against journal minima before export, and writes PDF/PNG via Inkscape when available or cairosvg otherwise.

Add to TypingMind

概览

发布者neuromechanist
代码仓库research-skills
技能名称scientific-figure
星标数
51
复刻数
9
附带文件
9
许可协议BSD-3-Clause
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 9 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 neuromechanist 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Scientific Figure AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/neuromechanist/research-skills/tree/main/plugins/figures/skills/scientific-figure
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/neuromechanist/research-skills.git /tmp/research-skills
mkdir -p .claude/skills
cp -r /tmp/research-skills/plugins/figures/skills/scientific-figure .claude/skills/scientific-figure
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Scientific Figure,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Scientific Figure。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Scientific Figure 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Scientific Figure

Compose publication-quality multi-panel figures at exact journal dimensions (mm/pt), validate font sizes against journal minima before export, and write PDF/PNG that the journal will accept without resize.

Why this skill exists

The previous react-pdf workflow had two structural failures:

  1. Composition did not respect physical size. Flexbox layout shifted dimensions in subtle ways during render.
  2. Fonts shrank below readable thresholds. When content overflowed, react-pdf uniformly scaled the entire figure, sometimes pushing axis labels under 4 pt.

This skill replaces that workflow. Panels are placed at exact mm coordinates, text is preserved as SVG <text> elements so font sizes are inspectable before export, and the validator rescales individual panels rather than the whole figure when a font minimum is violated.

Pipeline

1. Plan        2. Build elements        3. Compose          4. Validate fonts     5. Export
   (journal      (matplotlib/seaborn      (svgutils, at        (per-element pt vs    (Inkscape if
    size, panel   per panel; SVG out;     exact mm/pt;         journal minimum;      present;
    grid)         optional icons)         text preserved)      rescale panel if      cairosvg
                                                               below minimum)        otherwise)

Every step uses on-the-fly execution via uv run --with so no permanent installs are required for the skill itself.

Step 1: Plan the figure

Before generating anything, fix the following:

  • Target journal — sets the canvas width. See references/journal-specs.md for the full table; the four most common are summarized below.
  • Panel grid — 1x1, 1x2, 2x2, wide-top + sub-panels, or freeform mm coordinates.
  • Color palette — pick from references/color-palettes.md and reuse across all panels.

Journal width / font minimum cheat sheet

Journal1 column2 columnMin body fontNotes
Nature89 mm183 mm5 pt8 pt for panel labels
Science55 mm120 mm6 ptMyriad/Helvetica preferred
Cell85 or 112 mm174 mm6 ptMax 225 mm tall
PNAS87 mm180 mm6 ptNo label below 2 mm tall

The validator in step 4 enforces these. Pick the journal early so the validator can warn early.

Step 2: Build the elements

Each panel is generated independently as an SVG. Common sources:

  • Plots: matplotlib/seaborn, saved with bbox_inches='tight', transparent=True, format='svg'. See the figures:plot-styling skill for the library decision tree and SciencePlots recipes.
  • Icons: transparent PNGs from the figures:transparent-icons skill.
  • Schematics: for new Python-driven work use figures:svg-primitives (auto-fit boxes, validated arrows, layered z-order); for hand-authored SVG patterns see figures:svg-figure.

Save each element to a working directory (typically panels/), then compose them in step 3.

Step 3: Compose the figure

The composer is built around svgutils (MIT license; uv run --with svgutils). It places panels at exact mm coordinates and preserves text as inspectable SVG <text> elements.

Two ways to compose: the Figure helper in scripts/compose.py (most cases) and direct svgutils.compose for full control.

Recipe A: helper (recommended)

bash
uv run --with svgutils --with lxml python scripts/compose.py panels-config.json -o figure.svg

panels-config.json schema:

json
{
  "width_mm": 183,
  "height_mm": 120,
  "journal": "nature",
  "panels": [
    {"id": "A", "src": "panels/spectrum.svg", "x_mm": 0,  "y_mm": 0, "scale": 0.5, "label": "A"},
    {"id": "B", "src": "panels/topomap.svg",  "x_mm": 92, "y_mm": 0, "scale": 0.5, "label": "B"},
    {"id": "C", "src": "panels/timecourse.svg", "x_mm": 0, "y_mm": 60, "scale": 1.0, "label": "C", "width_mm": 183}
  ]
}

Panel labels (A, B, C) are placed at top-left of each panel in 12 pt bold sans-serif.

Recipe B: direct svgutils (full control)

python
from svgutils.compose import Figure, SVG, Panel, Text

fig = Figure(
    "183mm", "120mm",
    Panel(
        SVG("panels/spectrum.svg").scale(0.5),
        Text("A", 5, 15, size=12, weight="bold"),
    ).move(0, 0),
    Panel(
        SVG("panels/topomap.svg").scale(0.5),
        Text("B", 5, 15, size=12, weight="bold"),
    ).move(92, 0),
)
fig.save("figure.svg")

See references/composition-workflow.md for the patterns (panel scaling, label placement, scale bars, multi-panel grid utilities).

Step 4: Validate fonts before export

This is the step that prevents the journal-rejection scenario. Run:

bash
uv run --with lxml python scripts/validate_fonts.py figure.svg --journal nature

The validator parses every <text> and <tspan> element with a font-size, walks the accumulated transform stack to compute the effective font size at the final physical dimensions, and reports anything below the journal minimum. Output is JSON:

json
{
  "svg": "figure.svg",
  "journal": "nature",
  "minimum_pt": 5.0,
  "checked_count": 47,
  "skipped_count": 0,
  "issue_count": 1,
  "issues": [
    {
      "text": "Frequency (Hz)",
      "specified_pt": 9.0,
      "effective_pt": 4.5,
      "scale_x": 0.5,
      "scale_y": 0.5,
      "minimum_pt": 5.0,
      "tag_id": ""
    }
  ]
}

skipped_count counts text elements where no font-size could be resolved (CSS class selectors, inherited styles). Exit codes: 0 clean, 1 issues found, 2 script error (malformed SVG, missing file).

If a panel is the culprit (its .scale() is too small), three remedies:

  1. Rescale that panel up (and other panels down) instead of accepting the small text.
  2. Increase the source plot's font size so that even at panel scale 0.5 it still passes (e.g., 12 pt source → 6 pt at 0.5 scale, which passes Science 6 pt minimum).
  3. Switch to a larger canvas (e.g., upgrade 1-col to 1.5-col).

See references/font-validation.md for the full mechanics and rationale.

Step 5: Export to PDF/PNG

bash
uv run --with cairosvg python scripts/export.py figure.svg --out figure.pdf --dpi 300

export.py detects Inkscape on $PATH at runtime. When present, Inkscape produces the highest-fidelity PDF (text remains text, fonts subsetted). When absent, the script falls back to cairosvg with a stderr warning that text without an installed font may be converted to paths or skipped.

Installing Inkscape (one-time, recommended)

bash
brew install inkscape    # macOS
sudo apt install inkscape # Debian/Ubuntu

brew install inkscape is a single line and a ~200 MB one-time cost; once installed the script auto-detects it. The cairosvg fallback works without Inkscape but produces lower-fidelity PDFs when journal-required fonts are not installed.

Caption guidelines

Generate a figure caption that:

  • Starts with a concise title (bold, one sentence).
  • Describes each panel: "(A) Description. (B) Description. (C) Description."
  • Defines all abbreviations on first use (e.g., "electroencephalography (EEG)").
  • States sample sizes, statistical tests, and error bar meanings.
  • States scale bar values if present.

Quality assurance

The figures:figure-qa agent proactively runs on the composed SVG to check geometric correctness, alignment, color-palette compliance, and label legibility. The agent invokes validate_fonts.py for the font-size pass under the hood and the SVG branch's palette and geometry checks alongside.

Additional resources

  • references/composition-workflow.md — svgutils patterns and idioms
  • references/font-validation.md — pt minimum mechanics, transform-stack math
  • references/journal-specs.md — full table of journal dimensions and font rules
  • references/color-palettes.md — colorblind-safe palettes (Wong, Okabe-Ito, viridis, Crameri)
  • scripts/compose.py — svgutils composer (CLI + library)
  • scripts/validate_fonts.py — font-size validator
  • scripts/export.py — Inkscape/cairosvg exporter
  • examples/two-column-figure.py — end-to-end working example (matplotlib panels → compose → validate → export)

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Scientific Figure AI 技能有什么作用?

This skill should be used when the user asks to "create a figure", "make a scientific figure", "create a paper figure", "make a figure for my paper", "make a figure for my manuscript", "compose figure panels", "assemble figure panels", "combine figure panels", "make a multi-panel figure", "figure composition", "export a figure", "generate a PDF figure", "create a Nature-style figure", "make a journal figure", "make a publication figure", or "create a figure for my grant". The skill composes multi-panel figures at exact journal dimensions (Nature 89/183 mm, Science 55/120 mm, Cell 85/174 mm,...

为什么在 TypingMind 中使用 Scientific Figure?

因为您只需安装一次,就能搭配任何模型使用。Scientific Figure 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Scientific Figure?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/neuromechanist/research-skills/tree/main/plugins/figures/skills/scientific-figure。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Scientific Figure?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Scientific Figure 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Scientific Figure 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Scientific Figure AI 技能免费吗?

是的。neuromechanist 已在 GitHub 上根据 BSD-3-Clause 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇