Figures Python logo

Figures Python

CommunityPopular
Norman-bury
figures-python

Use when creating data visualizations for papers - generates publication-quality plots with top-journal color schemes

Overview

PublisherNorman-bury
Repositoryresearch-writing-skill
Skill namefigures-python
Stars
3.2K
Forks
214
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by Norman-bury on GitHub. Read the source before you install it.

Installation

Install the Figures Python AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Norman-bury/research-writing-skill.git /tmp/research-writing-skill
mkdir -p .claude/skills
cp -r /tmp/research-writing-skill/skills/figures-python .claude/skills/figures-python
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Figures Python in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Figures Python on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Figures Python is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Python 数据图表

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

Checklist

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

一、环境要求

1.1 conda 环境

默认环境名research

激活命令

bash
conda activate research

必需库

bash
pip install matplotlib seaborn numpy pandas

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

二、图表规范

2.0 数据清单与 mock 数据边界

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

text
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 至少记录:

FigureData fileReal/mockSourceScriptOutputs

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

2.1 分辨率要求

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

本技能默认使用 450 DPI

2.2 输出格式

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

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

2.3 图表尺寸

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

三、顶刊配色方案

3.1 Nature/Science 风格

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

3.2 Cell 风格

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

3.3 色盲友好配色

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

3.4 配色原则

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

四、代码模板

python
"""
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()

五、常用图表类型

折线图

python
ax.plot(x, y, color=COLORS[0], linewidth=1.5, marker='o', markersize=4)

柱状图

python
ax.bar(x_pos, values, color=COLORS[:len(values)], edgecolor='white')

热力图

python
im = ax.imshow(matrix, cmap='RdBu_r', aspect='auto')
plt.colorbar(im, ax=ax)

箱线图

python
bp = ax.boxplot(data_list, patch_artist=True)
for patch, color in zip(bp['boxes'], COLORS):
    patch.set_facecolor(color)

散点图

python
ax.scatter(x, y, c=colors, s=sizes, alpha=0.6, cmap='viridis')

六、文件管理

目录结构

figures/
├── chapter1/
│   ├── fig1_overview.py
│   ├── fig1_overview.png
│   └── fig1_overview.svg
├── chapter2/
└── chapter3/

命名规范

  • 文件名格式:fig{序号}_{描述}.py
  • 示例:fig1_model_architecture.py

七、质量检查

图表内容

  • 数据准确无误
  • 坐标轴标签完整(含单位)
  • 图例清晰可读

视觉效果

  • 使用顶刊配色
  • 分辨率达到 450 DPI
  • 字体大小适中

文件输出

  • PNG 格式已生成
  • SVG 格式已生成
  • 文件命名规范

八、常见问题

Q1:中文显示为方块

python
from matplotlib.font_manager import FontProperties
font = FontProperties(fname='/System/Library/Fonts/STHeiti Light.ttc')
ax.set_xlabel('中文标签', fontproperties=font)

Q2:图片模糊

python
plt.savefig('figure.png', dpi=450, bbox_inches='tight')

Q3:图例遮挡数据

python
ax.legend(loc='upper left', bbox_to_anchor=(1.02, 1))

Frequently asked questions

What does the Figures Python AI skill do?

Use when creating data visualizations for papers - generates publication-quality plots with top-journal color schemes

Why use Figures Python on TypingMind?

Because you install it once and use it with any model. Figures Python is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Figures Python in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Norman-bury/research-writing-skill/tree/main/skills/figures-python. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Figures Python?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Figures Python?

As many as you like. As long as a model supports skills, you can use Figures Python with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Figures Python AI skill free?

Yes. It is published on GitHub by Norman-bury under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇