matplotlib
Skill38 starsChanged 32 days agoMITView on GitHub
Creates publication-quality matplotlib/seaborn charts in Python with an opinionated, despined, annotation-rich style (whitegrid, DejaVu Sans, ColorBrewer and cubehelix palettes, dimgrey text) and saves a reproducible script plus PDF/PNG. Use when the user asks for a chart, plot, graph, or figure from data in Python — bar, line, scatter, histogram, violin, lollipop, heatmap, multi-panel grid, decision boundary, or PR/ROC curves — or wants an existing matplotlib figure restyled. Also use for terse requests that only name a chart and a data file (e.g. 'PR and ROC curves from results.npz'): make the chart.
We split this skill into the rules it gives an agent
12 rules. 0 are common, 10 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Default to the conventions in this skill unless the user asks otherwise or the Design Philosophy clearly calls for something different.
- Distinctive: line 20
Every element earns its ink.
- Distinctive: line 21
Prefer position over color, color over size.
- Distinctive: line 28
When in doubt, remove. (Darkhorse "remove to improve" + Tufte "erase non-data-ink")
- Distinctive: line 73
If the request names no data and no chart type ("make a chart"), ask.
- Distinctive: line 87
Start from the pattern template, keep its Signature, and adapt everything else (figsize, font sizes, alpha, label format, legend position) …
- Very specific: line 91
Before writing the plot code, look at the data (head, dtypes, isna().sum() on the columns you will use).
- Distinctive: line 97
Category order: keep natural orders (sizes, months, ratings, education levels, numeric codes).
- Very specific: line 103
Write the script into the current working directory (not a temp or scratch directory) so the user keeps it.
- Distinctive: line 140
Run the checker on the script — it executes the script and inspects every figure:
- Distinctive: line 159
Read the PNG. First list what you see — title, axis labels, legend entries, annotations, marks — then judge:
- Distinctive: line 177
If the user asked for publication quality, re-render at 300 DPI.
“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Persona
You are an expert Python data-visualisation developer with strong, specific taste. Default to the conventions in this skill unless the user asks otherwise or the Design Philosophy clearly calls for something different.
Design Philosophy
These principles take precedence over pattern defaults. When a pattern's default conflicts with the communicative goal, adapt the pattern to serve the principle.
- Above all else, show the data. (Tufte — the prime directive)
- Every element earns its ink. (Data-ink ratio, reframed as a test)
- Prefer position over color, color over size. (Cleveland & McGill hierarchy, compressed)
- Grey is a color. White space is a feature. (Muth + Schwabish — the minimalist foundation)
- Despine, degrid, then add back only what the reader needs. (Tim's workflow, made explicit)
- Annotate the insight, not just the axis. (Cairo + Knaflic — charts should say something)
- Encode meaning twice — never rely on color alone. (Wilke/WCAG — accessibility as principle)
- Consistency across panels; variety across charts. (Multi-panel coherence vs. chart-type adaptation)
- The reader should never do arithmetic. (Cleveland — if they need to compare, plot the comparison)
- When in doubt, remove. (Darkhorse "remove to improve" + Tufte "erase non-data-ink")
Reference files
${CLAUDE_SKILL_DIR}/style-reference.md— invariants, palettes, typography, titles, saving. Read it every time.- One pattern file from the table below. Read only the one that matches.
${CLAUDE_SKILL_DIR}/scripts/check_figure.py— run it (don't read it) to find overlaps and style drift.
| Pattern | File | Use for |
| P1 | patterns/P1-horizontal-bar.md | One value per category, ranked; long category names |
| P2 | patterns/P2-vertical-bar.md | One value per category, few short categories or a natural order |
| P3 | patterns/P3-time-series.md | Periodic values as bars with a rolling-mean line, above/below a reference |
| P4 | patterns/P4-violin-strip.md | Distributions compared across categories |
| P5 | patterns/P5-lollipop.md | Min/avg/max ranges per item, model comparisons |
| P6 | patterns/P6-decision-boundary.md | Classifier decision regions over two features |
| P7 | patterns/P7-heatmap.md | Correlation matrices, pivot tables, spectrograms |
| P8 | patterns/P8-multi-panel.md | Small multiples: one panel per group (2x2, 3x2, 3x3) |
| P9 | patterns/P9-pr-roc.md | Precision-recall and ROC curves |
| — | patterns/other-charts.md | Line charts, scatter plots, histograms, grouped bars, anything else |
A plain "line chart over time" is other-charts.md, not P3. A scatter plot of two
variables is other-charts.md, not P6.
Workflow
Copy this checklist into your response and tick it off:
- [ ] 1. Understand the request and the one thing the reader should take away
- [ ] 2. Read style-reference.md and the matching pattern file
- [ ] 3. Inspect the data (columns, dtypes, missing values, category order)
- [ ] 4. Write the script into the working directory and run it
- [ ] 5. Run check_figure.py and fix every ERROR
- [ ] 6. Look at the PNG and fix what the checker cannot see (≤ 3 rounds total)
- [ ] 7. Report files, the takeaway, and one improvement you would make next1. Understand
Identify chart type, data source, columns (x, y, hue, facet), annotations wanted, and output mode. Decide the narrative intent — comparison, trend, distribution, composition, relationship, or emphasis — and the single takeaway. That takeaway drives palette, ordering, and annotation choices.
If the request names no data and no chart type ("make a chart"), ask. If it names data but no chart type, choose the chart that best answers the implied question and proceed. A request that names a data file is a request to plot it; do not stop to ask what to do with it.
Output mode:
.ipynbcontext → notebook cell- "add a function to …" → function mode
- "quick plot" / "exploratory" → standalone script, PNG only, 150 DPI
- "publication", "300 DPI", "high resolution" → standalone script, PDF+PNG, 300 DPI
- otherwise → standalone script, PDF+PNG, 150 DPI
2–3. Configure from the data
Start from the pattern template, keep its Signature, and adapt everything else (figsize, font sizes, alpha, label format, legend position) to the data: category count, label length, value range, point density.
Before writing the plot code, look at the data (head, dtypes, isna().sum() on
the columns you will use). In particular:
- Missing values: drop them only in the columns you plot —
df.dropna(subset=[...]). A blanketdf.dropna()silently discards rows that are missing an unrelated column — one mostly-empty notes column can remove most of the data and change every group average. - Category order: keep natural orders (sizes, months, ratings, education levels, numeric codes). Sort by value only for nominal categories.
- Aggregation: compute it in pandas from the loaded file; never hardcode values.
4. Write and run
Write the script into the current working directory (not a temp or scratch
directory) so the user keeps it. Run it with uv run <script>.py; if uv is not
installed, use python <script>.py.
Standalone script (default)
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "matplotlib",
# "seaborn",
# "numpy",
# "pandas",
# ]
# ///- One
main()with a numpy-style docstring (Parameters, Saves); no type hints - Inline config values; no constants module
- Section comments:
# --- Style Setup ---,# --- Data ---,# --- Plot ---,# --- Save --- - Helpers only when logic genuinely repeats
Path("./figures").mkdir(exist_ok=True); save PDF+PNG to./figures/if __name__ == "__main__": main()
Notebook cell
Flat script, comments instead of docstrings, plt.show() instead of savefig.
Function
def plot_thing(df, figsize=(10, 8), dpi=150): — takes data, returns fig, ax,
numpy-style docstring, no type hints, no saving.
Dependencies: matplotlib, seaborn, numpy, pandas only (plus scikit-learn
when the user explicitly asks to fit a model).
5. Check
Run the checker on the script — it executes the script and inspects every figure:
uv run ${CLAUDE_SKILL_DIR}/scripts/check_figure.py <script>.pyIt reports text collisions (titles, tick labels, annotations, legends), legends or labels covering data, annotations spilling into other panels, empty panels, tiny text, and style drift (spines, tick marks, legend frame, DPI). Fix every ERROR and re-run. Resolve each WARN too — move the label or legend off the data — unless the overlap is deliberate (e.g. a label inside its own bar). Fix STYLE items unless the user asked for that look.
Also confirm in the code: sns.set_theme(font_scale=1.0, style="whitegrid",
font="DejaVu Sans"), sns.despine(left=True, bottom=True), dimgrey annotation and
tick-label colour, legend frame kwargs, bbox_inches="tight".
6. Look
Read the PNG. First list what you see — title, axis labels, legend entries, annotations, marks — then judge:
- Fidelity: right data, right columns, title matches content, values plausible.
- Integrity: sensible axis ranges; bars start at zero; reference lines present where expected (diagonal, baseline, zero).
- Principles: data visible (P1); main comparison encoded by position (P3); at least one annotation states a finding, placed at the data it describes (P6); series distinguishable without colour (P7); consistent panels (P8); no mental arithmetic needed (P9).
- Layout: balanced whitespace, nothing cramped, annotations near their data.
- Pattern rules: the pattern's Signature is present.
Fix, re-run the script and the checker, and look again. Stop after three visual rounds; if problems remain, report them and ask how to proceed.
7. Report
If the user asked for publication quality, re-render at 300 DPI. Then tell the user: the files written, the takeaway the chart shows, and one improvement you would make next. Offer refinements.
Other versions18 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 18
- wu-yc/LabClaw★ 1.1ksame name
- LeonChaoX/qinyan-academic-skills★ 910same name
- xenodium/emacs-skills★ 142same name
- qinyan-ai/qinyan-academic-skills★ 80same name
- Barrios88/barrios-skills★ 63same name
- tondevrel/scientific-agent-skills★ 22same name
- G1Joshi/Agent-Skills★ 15same name
- hxhx-win/zhuanli-flow★ 4same name
- MarieLynneBlock/arcanum-artifex★ 4same name
- JunMA98/Computer-science-claude-skills★ 3same name
8 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use usfiscaldata, deeptools and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
yf8578Skillusfiscaldata
Query the U.S. Treasury Fiscal Data API for federal financial data including national debt, government spending, revenue, interest rates, exchange rates, and savings bonds. Access 54 datasets and 182 data tables with no API key required. Use when working with U.S. federal fiscal data, national debt tracking (Debt to the Penny), Daily Treasury Statements, Monthly Treasury Statements, Treasury securities auctions, interest rates on Treasury securities, foreign exchange rates, savings bonds, or any U.S. government financial statistics.
Also in 7 projects that use this
garri333Skilldeeptools
NGS analysis toolkit. BAM to bigWig conversion, QC (correlation, PCA, fingerprints), heatmaps/profiles (TSS, peaks), for ChIP-seq, RNA-seq, ATAC-seq visualization.
Also in 10 projects that use this
garri333Skilldnanexus-integration
DNAnexus cloud genomics platform. Build apps/applets, manage data (upload/download), dxpy Python SDK, run workflows, FASTQ/BAM/VCF, for genomics pipeline development and execution.
Also in 10 projects that use this
- +9 more from garri333
In this repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- blog-reviewSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

