scientific-visualization
它能做什么
这项技能教智能体如何制作符合科学期刊标准的图形。内容涵盖版式、标注、色盲友好的配色方案以及导出格式。
适用场景
- ✓当研究人员需要为期刊投稿准备图形,例如符合 Nature、Science 或 Cell 风格的图的时候。
- ✓当用户需要带有误差线和显著性标记的多子图图形的时候。
- ✓当用户希望把已有图形改进到符合发表标准的时候。
技能链接
https://github.com/zLanqing/codex-claude-academic-skills/blob/main/scientific-toolkit-skill/references/scientific-skills/scientific-visualization/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把我的结果做成一张三联图,带误差线,并使用色盲友好的配色,用于我的期刊投稿。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会设置发表样式,把图形尺寸调整为期刊的栏宽,并在绘制数据时加上标签和单位。然后以合适的分辨率和格式导出图形。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Scientific Visualization
Overview
Scientific visualization transforms data into clear, accurate figures for publication. Create journal-ready plots with multi-panel layouts, error bars, significance markers, and colorblind-safe palettes. Export as PDF/EPS/TIFF using matplotlib, seaborn, and plotly for manuscripts.
When to Use This Skill
This skill should be used when:
- Creating plots or visualizations for scientific manuscripts
- Preparing figures for journal submission (Nature, Science, Cell, PLOS, etc.)
- Ensuring figures are colorblind-friendly and accessible
- Making multi-panel figures with consistent styling
- Exporting figures at correct resolution and format
- Following specific publication guidelines
- Improving existing figures to meet publication standards
- Creating figures that need to work in both color and grayscale
Quick Start Guide
Basic Publication-Quality Figure
import matplotlib.pyplot as plt
import numpy as np
# Apply publication style (from scripts/style_presets.py)
from style_presets import apply_publication_style
apply_publication_style('default')
# Create figure with appropriate size (single column = 3.5 inches)
fig, ax = plt.subplots(figsize=(3.5, 2.5))
# Plot data
x = np.linspace(0, 10, 100)
ax.plot(x, np.sin(x), label='sin(x)')
ax.plot(x, np.cos(x), label='cos(x)')
# Proper labeling with units
ax.set_xlabel('Time (seconds)')
ax.set_ylabel('Amplitude (mV)')
ax.legend(frameon=False)
# Remove unnecessary spines
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
# Save in publication formats (from scripts/figure_export.py)
from figure_export import save_publication_figure
save_publication_figure(fig, 'figure1', formats=['pdf', 'png'], dpi=300)
Using Pre-configured Styles
Apply journal-specific styles using the matplotlib style files in assets/:
import matplotlib.pyplot as plt
# Option 1: Use style file directly
plt.style.use('assets/nature.mplstyle')
# Option 2: Use style_presets.py helper
from style_presets import configure_for_journal
configure_for_journal('nature', figure_width='single')
# Now create figures - they'll automatically match Nature specifications
fig, ax = plt.subplots()
# ... your plotting code ...
Quick Start with Seaborn
For statistical plots, use seaborn with publication styling:
import seaborn as sns
import matplotlib.pyplot as plt
from style_presets import apply_publication_style
# Apply publication style
apply_publication_style('default')
sns.set_theme(style='ticks', context='paper', font_scale=1.1)
sns.set_palette('colorblind')
# Create statistical comparison figure
fig, ax = plt.subplots(figsize=(3.5, 3))
sns.boxplot(data=df, x='treatment', y='response',
order=['Control', 'Low', 'High'], palette='Set2', ax=ax)
sns.stripplot(data=df, x='treatment', y='response',
order=['Control', 'Low', 'High'],
color='black', alpha=0.3, size=3, ax=ax)
ax.set_ylabel('Response (μM)')
sns.despine()
# Save figure
from figure_export import save_publication_figure
save_publication_figure(fig, 'treatment_comparison', formats=['pdf', 'png'], dpi=300)
Core Principles and Best Practices
1. Resolution and File Format
Critical requirements (detailed in references/publication_guidelines.md):
- Raster images (photos, microscopy): 300-600 DPI
- Line art (graphs, plots): 600-1200 DPI or vector format
- Vector formats (preferred): PDF, EPS, SVG
- Raster formats: TIFF, PNG (never JPEG for scientific data)
Implementation:
# Use the figure_export.py script for correct settings
from figure_export import save_publication_figure
# Saves in multiple formats with proper DPI
save_publication_figure(fig, 'myfigure', formats=['pdf', 'png'], dpi=300)
# Or save for specific journal requirements
from figure_export import save_for_journal
save_for_journal(fig, 'figure1', journal='nature', figure_type='combination')
2. Color Selection - Colorblind Accessibility
Always use colorblind-friendly palettes (detailed in references/color_palettes.md):
Recommended: Okabe-Ito palette (distinguishable by all types of color blindness):
# Option 1: Use assets/color_palettes.py
from color_palettes import OKABE_ITO_LIST, apply_palette
apply_palette('okabe_ito')
# Option 2: Manual specification
okabe_ito = ['#E69F00', '#56B4E9', '#009E73', '#F0E442',
'#0072B2', '#D55E00', '#CC79A7', '#0
常见问题
它提到了哪些期刊?
这项技能把 Nature、Science、Cell 和 PLOS 列为期刊指南的示例。
它适合快速探索数据吗?
不适合。这项技能说明,快速探索应直接使用 seaborn 或 plotly。
它能导出哪些文件格式?
这项技能说明图形可导出为 PDF、EPS 或 TIFF。
详情
作者的原始描述
Meta-skill for publication-ready figures. Use when creating journal submission figures requiring multi-panel layouts, significance annotations, error bars, colorblind-safe palettes, and specific journal formatting (Nature, Science, Cell). Orchestrates matplotlib/seaborn/plotly with publication styles. For quick exploration use seaborn or plotly directly.
热度
- GitHub 星标
- 5.6k
- 排名
- #14771
- 许可证
- MIT
- 更新时间
- 2026/5/14
评论
- …
同一仓库的更多技能
office-academic-skill
5.6k帮你的智能体把研究论文整理为 Word 报告,并制作可编辑、以中文为主的学术 PowerPoint 幻灯片,包含演讲者备注和版式检查。
research-writing-skill
5.6k帮你的智能体撰写、修改和润色研究论文的各部分、摘要以及审稿意见回复,并保持公式、标题和参考文献原样不变。
scientific-toolkit-skill
5.6k帮你的智能体为信号与图像处理、统计分析、仿真以及可用于发表的图表编写和调试 MATLAB 或 Python 科学代码。
matlab
5.6k帮你的智能体编写和调试 MATLAB 与 GNU Octave 脚本,用于矩阵运算、信号与图像处理、微分方程、优化以及绘图。