figures-python

figures-python is a skill for Claude Code, Codex from Norman-bury/research-writing-skill. It costs 23 tokens per session (1,908 once invoked), scanned A, original, MIT.

A Python workflow for making charts for research papers. Python is a programming language, and the workflow specifies publication-oriented colours, resolution, file formats, data records, and checks for Chinese text.

In plain words
What is it for?
Use it to create plots from data, export PNG and SVG versions, save scripts and outputs in the expected folders, and label synthetic planning data correctly.
Why use it?
It removes guesswork about how to prepare consistent figures for journal submission. It also makes the data source and whether data is real or mock explicit.

Skill for Claude CodeCodex

Part of the research-writing-skill plugin — 20 skills, 1 hook shipped together

About the project

Norman-bury/research-writing-skill is an agent skill that turns academic paper writing into a tracked, reusable workflow with planning, drafting, reviews, figures, literature work, and LaTeX outputs. It is intended for undergraduate students, graduate students, and early-career researchers working on theses, coursework papers, or initial submissions. Its catalogue entries are the skills, instructions, plugin, and hook that implement the workflow across coding-agent platforms.

Norman-bury/research-writing-skill · 3,151 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/norman-bury/research-writing-skill/figures-python
Any agent
npx skills add Norman-bury/research-writing-skill --skill figures-python
Clone the repo
git clone --depth 1 https://github.com/Norman-bury/research-writing-skill

Made for: Claude Code, Codex.

Or install research-writing-skill, the plugin that ships this one along with the rest of its 20 skills, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for figures-python

README.md
[![agentmods](https://agentmods.dev/badge/skills/norman-bury/research-writing-skill/figures-python.svg)](https://agentmods.dev/skills/norman-bury/research-writing-skill/figures-python)
Your own site
<a href="https://agentmods.dev/skills/norman-bury/research-writing-skill/figures-python"><img src="https://agentmods.dev/badge/skills/norman-bury/research-writing-skill/figures-python.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,908 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00023 $0.01908
Opus 5 $0.00012 $0.00954
Sonnet 5 $0.00005 $0.00382
Haiku 4.5 $0.00002 $0.00191

Measured 4d ago against content hash 2745e90de215, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

figures-python scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/figures-python/SKILL.md · 273 lines

How it starts

The opening of the file, as written. The whole thing — 273 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python 数据图表

本技能指导使用 Python 生成科研论文级别的数据图表。

Checklist

  • 确认 conda 环境已激活(research)
  • 确认图表类型和数据
  • 记录数据清单(data manifest)
  • 若使用 mock/synthetic 数据,明确标注为 planning data
  • 使用顶刊配色方案
  • 设置 450 DPI 分辨率
  • 同时输出 PNG 和 SVG
  • 检查中文字体显示
  • 保存到 figures/ 目录

一、环境要求

1.1 conda 环境

默认环境名research

激活命令

conda activate research

必需库

pip install matplotlib seaborn numpy pandas

如环境未配置,调用 environment-setup 技能。

二、图表规范

2.0 数据清单与 mock 数据边界

任何数据图都必须先有数据文件和数据清单(data manifest)。默认路径:

figures/data-manifest.md
figures/data/<figure-name>.csv
figures/<section>/<figure-name>.py
figures/<section>/<figure-name>.png
figures/<section>/<figure-name>.svg

figures/data-manifest.md 至少记录:

Figure Data file Real/mock Source Script Outputs

mock 或 synthetic 数据只允许用于规划版图表。文件名必须以 mock_synthetic_ 开头,并在图表、表格或章节草稿中保留 [待真实实验替换]。不得把 mock 数据写成“实验结果表明”。

2.1 分辨率要求

用途 DPI 说明
期刊投稿 300-600 大多数期刊要求
顶刊投稿 450+ Nature/Science等
屏幕展示 150 PPT/网页

本技能默认使用 450 DPI

2.2 输出格式

每张图同时输出两种格式:

  • PNG:位图,适合网页和PPT
  • SVG:矢量图,适合期刊投稿

2.3 图表尺寸

类型 宽度(英寸) 适用场景
单栏图 3.5 期刊单栏
双栏图 7.0 期刊双栏/全宽
PPT图 10.0 演示文稿

三、顶刊配色方案

3.1 Nature/Science 风格

NATURE_COLORS = ['#2E86AB', '#A23B72', '#F18F01', '#C73E1D', '#95C623']

3.2 Cell 风格

CELL_COLORS = ['#4E79A7', '#F28E2B', '#E15759', '#76B7B2', '#59A14F', '#EDC948']

3.3 色盲友好配色

COLORBLIND_SAFE = ['#0077BB', '#33BBEE', '#009988', '#EE7733', '#CC3311', '#EE3377']

3.4 配色原则

  • ❌ 禁止使用 matplotlib 默认颜色
  • ❌ 禁止使用纯红、纯蓝、纯绿等基础色
  • ✅ 同一图中颜色数量控制在 5 种以内
  • ✅ 确保色盲友好

四、代码模板

"""
Figure X: [图表标题]
论文章节: [所属章节]
"""

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.font_manager as fm
from pathlib import Path

# 中文字体配置
CHINESE_FONT = None
font_candidates = [
    '/System/Library/Fonts/STHeiti Light.ttc',
    '/System/Library/Fonts/PingFang.ttc',
]
for fp in font_candidates:
    if Path(fp).exists():
        CHINESE_FONT = fm.FontProperties(fname=fp)
        break

plt.rcParams['axes.unicode_minus'] = False

# 顶刊配色
COLORS = ['#4E79A7', '#F28E2B', '#E15759', '#76B7B2', '#59A14F']

def setup_plot_style():
    plt.rcParams.update({
        'font.size': 10,
        'axes.titlesize': 12,
        'axes.labelsize': 10,
        'axes.spines.top': False,
        'axes.spines.right': False,
        'axes.grid': True,
        'grid.alpha': 0.3,
        'legend.frameon': False,
        'savefig.dpi': 450,
        'savefig.bbox': 'tight',
    })

def main():
    setup_plot_style()
    
    fig, ax = plt.subplots(figsize=(7, 5))
    
    # === 绑定代码 ===
    x = np.linspace(0, 10, 100)
    ax.plot(x, np.sin(x), color=COLORS[0], label='Model A')
    ax.plot(x, np.cos(x), color=COLORS[1], label='Model B')
    
    if CHINESE_FONT:
        ax.set_xlabel('时间 (s)', fontproperties=CHINESE_FONT)
        ax.set_ylabel('幅值', fontproperties=CHINESE_FONT)
    else:
        ax.set_xlabel('Time (s)')
        ax.set_ylabel('Amplitude')
    
    ax.legend()
    # === 绑定代码结束 ===
    
    # 保存
    output_dir = Path(__file__).parent
    fig_name = Path(__file__).stem
    plt.savefig(output_dir / f'{fig_name}.png', dpi=450)
    plt.savefig(output_dir / f'{fig_name}.svg')
    plt.show()

if __name__ == '__main__':
    main()

Read the full file on GitHub · 273 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 273 lines · 23 tokens per session scan A 2745e90de215

Subscribe to this mod's changes

figures-python is a skill published in the GitHub repository Norman-bury/research-writing-skill (3,151 stars, last pushed 2mo ago), licensed MIT. It adds 23 tokens to every session and 1,908 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

exploratory-data-analysis

Perform bounded, local exploratory analysis of explicitly supported scientific files. Use for redacted CSV/TSV/JSON profiles; optional NumPy, HDF5, FASTA/FASTQ, and basic image metadata inspection; missingness/leakage audits; outlier and transformation sensitivity; and rigorous EDA report scaffolds. Other domain…

K-Dense-AI/scientific-agent-skills · 83 tokens

evaluating-with-leakage-gates

Evaluate an OpenMed de-identification or clinical NER model against the leakage-first release gates G1a through G8, which gate releases on residual PHI leakage rather than on F1. Use when the user wants to run the OpenMed eval harness on a synthetic golden set, decide whether a de-id model is RELEASABLE or…

maziyarpanahi/openmed · 158 tokens

mapping-to-snomed

Maps clinical concept spans extracted by OpenMed to SNOMED CT concepts through a USER-SUPPLIED terminology server (the user's own Ontoserver, Snowstorm, or UMLS/UTS), never a bundled vocabulary. Use when the user wants to code findings, disorders, procedures, body structures, or substances to SNOMED CT, run an ECL…

maziyarpanahi/openmed · 205 tokens

mixed-precision

Use FP16/BF16 mixed precision to accelerate training and reduce memory. Use when optimizing GPU performance.

aiming-lab/AutoResearchClaw · 25 tokens

tooluniverse-drug-research

Comprehensive drug profiling — mechanism, primary/secondary targets, drug interactions, clinical-trial status, adverse events (FAERS), pharmacogenomics, and approval history. Use for full drug investigation reports, 'tell me about drug X' queries, and assembling drug profiles for clinicians, researchers, or regulatory…

mims-harvard/ToolUniverse · 71 tokens

audit-scientific-figure

Review and score an existing scientific illustration in visible draw.io, Microsoft PowerPoint, or WPS Presentation without hiding defects through flattening. Use for reference-fidelity checks, layout cleanup, connector review, text-fit checks, deep editability and raster-atomicity inspection, local-region gates, or…

icebird1998/scientific-illustrator · 80 tokens