nature-figure
Generate publication-quality figures for top-tier journals (Nature, Science, Cell, ACS, Wiley families) using Python (matplotlib) or R (ggplot2). Trigger when…
от Yang1Bai★ 22 звезды на GitHub
Установить nature-figure в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
nature-figure
Purpose
Generate multi-panel scientific figures that meet Nature portfolio visual standards: correct typography, semantic colour palette, accessible design, and editable SVG output.
Trigger Conditions
Activate when user mentions:
- "画图" / "figure" / "plot" / "科研绘图"
- "Nature figure" / "publication figure" / "publication plot"
- "matplotlib" / "ggplot" / "seaborn"
- "配色" / "color palette" / "color scheme"
- Wants to improve or reformat an existing figure
Nature Figure Standards
Typography
- Font family: Arial or Helvetica (sans-serif, never Times New Roman in figures)
- Minimum font size in final print: 7 pt (axis labels, tick labels)
- Panel labels (a, b, c...): 8 pt bold, lowercase
- Figure title (if any): not embedded in figure — goes in legend
- All text must be editable (not rasterized)
Size & Resolution
| Format | Width | Resolution |
|---|---|---|
| Single column | 89 mm (3.5 in) | 300 DPI min |
| 1.5 column | 120 mm (4.7 in) | 300 DPI min |
| Double column | 183 mm (7.2 in) | 300 DPI min |
| Line art | any | 600 DPI |
| Final submission | PDF or TIFF | vector preferred |
Colour Palette (Nature-approved, colorblind-safe)
NATURE_COLORS = {
"blue": "#4878CF",
"red": "#D65F5F",
"green": "#6ACC65",
"orange": "#EE854A",
"purple": "#956CB4",
"teal": "#82C6E2",
"brown": "#D5BB67",
"gray": "#8C8C8C",
# Colorblind-safe primary pair:
"cb_blue": "#0072B2",
"cb_orange":"#E69F00",
}
- Never use pure red + green together (colorblind conflict)
- Use filled symbols + different shapes for accessibility, not colour alone
- Grayscale must remain distinguishable
Panel Architecture
- Each panel makes one clear point
- Panel (a): overview / schematic / representative image
- Panels (b–d): quantitative evidence
- Final panel: comparison or generalizability
- Panels are labelled a, b, c (lowercase bold, top-left corner)
- White background; minimal gridlines (light gray, 0.5pt)
- No chartjunk: remove top and right spines
Statistical Annotations
- Error bars: always define in legend (mean ± s.d. or ± s.e.m.)
- Significance: *, **, ***, **** for p < 0.05, 0.01, 0.001, 0.0001; prefer exact p-values
- n must be stated (e.g., n = 5 independent experiments)
- Box plots: show median, IQR, whiskers to 1.5×IQR, individual points overlaid
Workflow
Step 0: Auto-figure from data file (fastest path)
If user provides a CSV, Excel, or JSON data file:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/auto_figure.py \
--input <data_file> \
--output ~/Downloads/figure_<date>.pdf \
--title "[figure title]" \
--xlabel "X axis label" \
--ylabel "Y axis label" \
--type [auto|line|bar|scatter|heatmap|box]
The script auto-detects column types, chooses appropriate chart type, applies Nature style, and saves PDF + PNG.
Step 1: Gather requirements (if no data file yet)
Ask the user:
- What data do you have? (paste CSV, describe columns, or share values)
- How many panels? What does each panel show?
- Single/1.5/double column width?
- Python (matplotlib/seaborn) or R (ggplot2)?
- Any specific colour requirements or journal sub-style?
Step 2: Generate figure code
Python template (matplotlib):
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
# --- Nature style settings ---
plt.rcParams.update({
'font.family': 'Arial',
'font.size': 8,
'axes.linewidth': 0.8,
'axes.spines.top': False,
'axes.spines.right': False,
'xtick.major.width': 0.8,
'ytick.major.width': 0.8,
'xtick.major.size': 3,
'ytick.major.size': 3,
'xtick.direction': 'out',
'ytick.direction': 'out',
'figure.dpi': 300,
'savefig.dpi': 300,
'savefig.bbox': 'tight',
'savefig.pad_inches': 0.05,
'pdf.fonttype': 42, # editable text in PDF
'ps.fonttype': 42,
})
COLORS = {
"blue": "#4878CF", "red": "#D65F5F", "green": "#6ACC65",
"orange": "#EE854A", "purple": "#956CB4", "teal": "#82C6E2",
"cb_blue": "#0072B2", "cb_orange": "#E69F00",
}
# --- Figure layout ---
fig = plt.figure(figsize=(7.2, 4.0)) # double column, adjust height
gs = gridspec.GridSpec(1, 3, figure=fig, wspace=0.4, hspace=0.4)
ax_a = fig.add_subplot(gs[0])
ax_b = fig.add_subplot(gs[1])
ax_c = fig.add_subplot(gs[2])
# --- Panel labels ---
for ax, label in zip([ax_a, ax_b, ax_c], ['a', 'b', 'c']):
ax.text(-0.15, 1.05, label, transform=ax.transAxes,
fontsize=8, fontweight='bold', va='top', ha='right')
# --- YOUR DATA GOES HERE ---
# ax_a: ...
# ax_b: ...
# ax_c: ...
plt.savefig('figure1.pdf', format='pdf')
plt.savefig('figure1.png', dpi=300)
print("Saved: figure1.pdf, figure1.png")
R template (ggplot2):
library(ggplot2)
library(patchwork)
# Nature theme
theme_nature <- function() {
theme_classic(base_size = 8, base_family = "Arial") +
theme(
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл nature-figure?
Generate publication-quality figures for top-tier journals (Nature, Science, Cell, ACS, Wiley families) using Python (matplotlib) or R (ggplot2). Trigger when user wants to create, polish, or redesign scientific figures for high-impact journals. Handles multi-panel layouts, Nature color palettes, correct typography, and exports SVG/PDF/PNG.
Как установить скилл nature-figure?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nature-figure запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…