matplotlib · davila7 — Claude Code skill: plots and publication figures
A Claude skill for matplotlib: line plots, scatter, bar, histograms, heatmaps and 3D figures, exported to PNG, PDF or SVG.
npx claude-code-templates@latest --skill scientific/matplotlibWhat matplotlib does
The skill teaches the agent how to use matplotlib: the pyplot interface in MATLAB style and the object-oriented Figure/Axes API, the object hierarchy, plot types and saving figures. It ships code samples for line plots, scatter, bar charts, histograms, heatmaps, contours, box and violin plots, plus 3D through mpl_toolkits.mplot3d.
Multi-panel layouts get their own section: a plain plt.subplots grid, subplot_mosaic and GridSpec when you need full control. Styling covers named colors, hex codes, RGB tuples, colormaps such as viridis and coolwarm, style sheets and rcParams tweaks. Export goes through plt.savefig with dpi, bbox_inches='tight' and transparent.
The examples assume Python with matplotlib and numpy installed, so drop the skill into a project that already has both. For publication figures the guidance points to dpi=300, for web output 150. If your charts come from a different library, the extra hints just add noise for the agent.
What it helps with
- plot a time series with labeled axes
- build a four-panel grid mixing plot types
- render a correlation matrix as a heatmap with a colorbar
- export a figure to PDF for a paper
- draw a 3D surface from X, Y, Z arrays
Example prompts for the agent
- plot sin(x) and cos(x) on one Axes with a legend and grid
- make a 2x2 figure with line, scatter, bar and histogram, save it as PNG at dpi=300
- draw a heatmap of the matrix with imshow, colormap coolwarm, and add a colorbar
How to install matplotlib
1claude-code-templates
npx claude-code-templates@latest --skill scientific/matplotlib2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill matplotlib -a claude-code3Manually: put the files in place
~/.claude/skills/matplotlib/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/matplotlib/
Manually: put the files in place
.agents/skills/matplotlib/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/matplotlib/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates matplotlib2Manually: put the files in place
.github/skills/matplotlib/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/scientific/matplotlibManually: put the files in place
.devin/skills/matplotlib/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about matplotlib
How do I install the matplotlib skill in Claude?
Use the templates command: npx claude-code-templates@latest --skill scientific/matplotlib. Or pull it straight from the repo: npx skills add davila7/claude-code-templates --skill matplotlib -a claude-code.
What does the matplotlib skill do?
It guides the agent through matplotlib plotting, from simple line charts to 3D, with styling options and export to PNG, PDF and SVG.
What do I need for the skill to work?
Python with matplotlib and numpy installed — the samples use both packages.
Similar skills
Everything for Science and research →matplotlib by other authors comes first.