/matplotlib:matplotlib [chart request, e.g. 'bar chart of accuracy by model from results.csv']from matplotlib
Creates publication-quality matplotlib/seaborn charts in Python with an opinionated, annotation-rich style. Handles bar, line, scatter, histogram, violin, lollipop, heatmap, multi-panel grids, decision boundaries, and PR/ROC curves.
Ships in matplotlib. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
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.
These principles take precedence over pattern defaults. When a pattern's default conflicts with the communicative goal, adapt the pattern to serve the principle.
${CLAUDE_SKILL_DIR}/style-reference.md — invariants, palettes, typography, titles, saving. Read it every time.${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.
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 next
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:
.ipynb context → notebook cellStart 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:
df.dropna(subset=[...]). A blanket df.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.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.
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "matplotlib",
# "seaborn",
# "numpy",
# "pandas",
# ]
# ///
main() with a numpy-style docstring (Parameters, Saves); no type hints# --- Style Setup ---, # --- Data ---, # --- Plot ---, # --- Save ---Path("./figures").mkdir(exist_ok=True); save PDF+PNG to ./figures/if __name__ == "__main__": main()Flat script, comments instead of docstrings, plt.show() instead of savefig.
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).
Run the checker on the script — it executes the script and inspects every figure:
uv run ${CLAUDE_SKILL_DIR}/scripts/check_figure.py <script>.py
It 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".
Read the PNG. First list what you see — title, axis labels, legend entries, annotations, marks — then judge:
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.
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.
patterns/P1-horizontal-bar.md (opens in a new tab)patterns/P2-vertical-bar.md (opens in a new tab)patterns/P3-time-series.md (opens in a new tab)patterns/P4-violin-strip.md (opens in a new tab)patterns/P5-lollipop.md (opens in a new tab)patterns/P6-decision-boundary.md (opens in a new tab)patterns/P7-heatmap.md (opens in a new tab)patterns/P8-multi-panel.md (opens in a new tab)patterns/P9-pr-roc.md (opens in a new tab)patterns/other-charts.md (opens in a new tab)scripts/check_figure.py (opens in a new tab)style-reference.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (tvhahn/matplotlib-skill) — no native marketplace selected
npx claudepluginhub p/tvhahn-matplotlibOther plugins' skills for the same job