AgentSkillsCN

figures4papers-python-plot-skill

当用户需要生成或重构ChenLiu-1996/figures4papers风格的Python绘图脚本时使用此功能,包括assets/outputs以及figure_*源文件夹。当用户提出“绘制论文图表”“根据脚本重现图表”“添加新的图表模块”或“批量运行绘图脚本,并统一采用符合出版质量的输出设置”等需求时,即可触发此功能。

SKILL.md
--- frontmatter
name: figures4papers-python-plot-skill
description: Use when generating or refactoring Python figure scripts in the ChenLiu-1996/figures4papers style, including assets/ outputs and figure_* source folders. Trigger for requests like "draw paper figure", "reproduce figure from script", "add a new figure module", or "batch-run plotting scripts with consistent publication-quality output settings."

figures4papers-python-plot-skill

Overview

Implement publication-ready Python plotting workflows using the figures4papers layout (assets/ plus domain-specific figure_* directories).

Workflow

  1. Detect repository layout.
  2. Create or update a dedicated figure_* folder for each figure task.
  3. Keep plotting code deterministic and save outputs to assets/.
  4. Run scripts and verify generated files exist and are non-empty.

Layout Rules

  • Keep rendered files in assets/.
  • Keep source code in figure_* directories.
  • Use stable output names under assets/ (for example: assets/figure_3.png, assets/figure_3.pdf).
  • Prefer one entry script per figure directory (for example: figure_Dispersion/plot.py).

Repository Coverage

Cover these known folders from ChenLiu-1996/figures4papers:

  • figure_CellSpliceNet
  • figure_Cflows
  • figure_Dispersion
  • figure_FPGM
  • figure_ImmunoStruct
  • figure_RNAGenScape
  • figure_brainteaser
  • figure_ophthal_review

Cover these known README figure categories:

  • Bar plots for quantitative comparison
  • Composition and breakdown charts
  • Trend/line plots
  • Heat maps
  • 3D sphere visualizations
  • Miscellaneous examples

Implementation Checklist

  • Confirm Python environment and plotting dependencies are available.
  • Add clear constants for seed, DPI, size, and output paths.
  • Save at least one vector or high-resolution output (.pdf or high-DPI .png).
  • Use tight_layout()/equivalent to avoid clipping labels.
  • Exit with non-zero code on failed render.

Quick Commands

bash
python scripts/check_repo_coverage.py --root .
python scripts/run_figure.py --figure-dir figure_Dispersion --entry plot.py --out assets/figure_dispersion.png

References

  • Read references/repo-style.md before generating or refactoring figure folders.