figure-matplotlib
Use when drawing a data figure with matplotlib/seaborn — pick a named pattern script (line, CI band, grouped bar, violin, scatter+fit, heatmap, ROC/PR, or 2×2), copy it with the style file, fill real data, experiment-run, stop when PDF/PNG land in the figures folder. Not for architecture/schematics (→ figure-typst if the manuscript root is .typ, else → figure-tikz), Observable Plot vocab (→ figure-observable-plot), manuscript wiring (→ figure-pipeline), or chat panel cards (→ figure-interaction).
- License 许可
- MIT
- 最近更新
- 2026-09-05
- Stars
- ★ 4
- Forks
- 0
01 前言 Front Matter
- name
- figure-matplotlib
- license
- MIT
- description
- Use when drawing a data figure with matplotlib/seaborn — pick a named pattern script (line, CI band, grouped bar, violin, scatter+fit, heatmap, ROC/PR, or 2×2), copy it with the style file, fill real data, experiment-run, stop when PDF/PNG land in the figures folder. Not for architecture/schematics (→ figure-typst if the manuscript root is .typ, else → figure-tikz), Observable Plot vocab (→ figure-observable-plot), manuscript wiring (→ figure-pipeline), or chat panel cards (→ figure-interaction).
02 资源文件 13
- 资产文件assets/prism.mplstyle1.2 KB
- 参考文档references/chart-selection.md1.8 KB
- 参考文档references/colorblind-palettes.md1.3 KB
- 参考文档references/figure-qc.md2.9 KB
- 参考文档references/journal-sizing.md3.0 KB
- 脚本scripts/plot_box_violin.py2.2 KB
- 脚本scripts/plot_grouped_bar.py1.8 KB
- 脚本scripts/plot_heatmap.py1.7 KB
- 脚本scripts/plot_multipanel.py4.0 KB
- 脚本scripts/plot_roc_pr.py2.8 KB
- 脚本scripts/plot_scatter_fit.py1.6 KB
- 脚本scripts/plot_template.py1.7 KB
- 脚本scripts/plot_timeseries_ci.py1.8 KB
03 SKILL.md 正文
Figure: Matplotlib & Seaborn
Start from a named pattern and the style file. Run it. When the PDF is
in the figures folder, the job is done. scripts/ and assets/ below
are in this skill folder (next to SKILL.md), not the project root.
Backends: matplotlib first; seaborn is the same pipeline. Other backends or 3D only when the user asks.
Pick one pattern
| Ask | Start from |
|---|---|
| One panel line (loss, metric vs step) | scripts/plot_template.py |
| Trend + named interval band | scripts/plot_timeseries_ci.py |
| Grouped bar + error | scripts/plot_grouped_bar.py |
| Group comparison (distribution) | scripts/plot_box_violin.py |
| Two-variable scatter + claimed fit | scripts/plot_scatter_fit.py |
| Matrix / correlation | scripts/plot_heatmap.py |
| ROC / precision-recall | scripts/plot_roc_pr.py |
| Multi-panel (2×2, shared colorbar) | scripts/plot_multipanel.py |
| Architecture / schematic | Stop. figure-tikz |
| Density / hexbin / facets / geo | Stop. figure-observable-plot |
Do not start from an empty pyplot script. Do not invent a ninth
pattern when one of the rows matches.
Closed path
Four steps. No reconnaissance.
- Copy both files — the matching
scripts/plot_*.pyandassets/prism.mplstyleinto the experiment island or scripts folder. The script loads the style next to itself; copying the script alone drops the style. Rename the script to the figure. - Fill data in that script — load from a run artifact or a real
CSV on disk. Keep loading and plotting in the same file. Axis
labels include units. Use the style file's cycle; do not invent a
palette. Output directory = the project's figures folder
(Workspace Folder Descriptions — do not guess
figures/if the project uses another name). - Run —
experiment-run(project venv injected). Ifimport matplotlibfails:uv pip install matplotlib numpyinto.prismnext/.venvonly — never the system Python, neverwhich python. On error: edit the script, run again. - Stop. Chat already previews the PDF/PNG.
Done = that PDF (and preview PNG) exist. One short sentence in chat (what the figure shows). Nothing else.
Do not (unless the user named that next step):
- Read
references/chart-selection.md/journal-sizing.md/figure-qc.mdas a prelude — those are for a stuck chart-type or a submission pass, not for drawing \includegraphicsinto the manuscript,latex-compile, orinteraction-write- bash
which/ raster converters / deleting the output - Hand-edit the PNG/PDF
Those are figure-pipeline, figure-interaction, or a later user ask.
Craft (on demand)
- Figures regenerate from the script — never patch the output image.
- PDF for print; PNG is the chat preview the pattern already writes.
- Caption names the interval (95% CI / SD / …) and n when the pattern draws a band or error bar.
references/chart-selection.mdonly when the chart type is actually unclear.references/colorblind-palettes.mdonly when you must leave the style cycle.references/figure-qc.mdonly before submission.
04 同仓库更多 Skills
demo-multi-file
Local test skill with an extra notes file
writing-results
Use when drafting a Results / Experiments / Analysis section — narrating verified evidence from run receipts, with complete statistical reporting, derivation analysis, and honest treatment of negative results. Every number traces to a run; every claim survives the audit.
writing-related-work
Use when drafting a Related Work / literature review section or a standalone synthesis note — organizing prior work into a grounded, cited narrative or comparing methods across papers, from the project library plus staged external discovery. Never cites from memory.
writing-preliminaries
Use when drafting a Preliminaries / Background / Notation section — definitions, problem setup, and formal statements the rest of the paper builds on, with notation consistency and machine-checked formal claims. Reference patterns, not molds; include only what later sections actually use.
writing-methods
Use when drafting a Methods / Methodology / Approach / Model section — expounding the ideas and the reasoning behind the method, grounded in the project's brief, notes, and prior discussions, with empirical details from run receipts. Structure follows the idea's shape; reference angles, not fixed templates.
writing-introduction
Use when drafting or rewriting a paper's Introduction — framing the problem, positioning against prior work, and stating contributions as checkable claims, grounded in the brief, notes, and the library. Reference rhetorical patterns, adapted to the paper — never applied as molds.