matplotlib

Create customizable static, animated, and 3D plots in Python with matplotlib.

Updated Oct 7, 2022
One-click install
npx skills add https://github.com/tamagusko/linux-cfg --skill matplotlib-tamagusko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matplotlib
Source: https://github.com/tamagusko/linux-cfg/tree/main/dotfiles/claude/skills/matplotlib
Command: npx skills add https://github.com/tamagusko/linux-cfg --skill matplotlib-tamagusko

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires matplotlib, numpy, scipy, and includes scripts (resource) and references (resource) components.

What problem does it solve? Creating publication-quality figures in Python requires knowing matplotlib's dual interfaces, dozens of plot types, styling options, and export settings, which is difficult to get right without guidance. ## Core Features & Use Cases - Full plot type coverage: Line, scatter, bar, histogram, heatmap, contour, box, violin, polar, and 3D plots with code examples for each. - Styling and export control: Colormap selection, rcParams configuration, style sheets, and PNG/PDF/SVG export at publication DPI. - Helper scripts and references: A plot template script, an interactive style configurator, and reference docs covering the API, plot types, styling, and troubleshooting. - Use Case: A researcher needs a multi-panel figure with a shared colorbar exported at 300 DPI for a journal submission; the skill provides the GridSpec layout pattern, constrained_layout guidance, and savefig settings. ## Quick Start Ask the AI to create a matplotlib figure, for example: plot a sine and cosine wave with labels, legend, and grid, then save it as a 300 DPI PNG.

Frequently Asked Questions about matplotlib

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create subplots in matplotlib?

Use plt.subplots(nrows, ncols) to create a figure with a grid of axes, then index into the returned axes array. For irregular layouts, use plt.subplot_mosaic or GridSpec to span rows and columns.

Should I use pyplot or the object-oriented matplotlib interface?

The object-oriented interface (fig, ax = plt.subplots()) is recommended for most code because it gives explicit control over figures and axes. Reserve the pyplot state-machine interface for quick interactive exploration.

Matplotlib vs seaborn vs plotly: which should I use?

Use matplotlib for fine-grained control over every plot element and custom plot types. Use seaborn for quick statistical plots and plotly for interactive visualizations; both integrate with or complement matplotlib.

How do I save a matplotlib figure at high resolution?

Call plt.savefig with dpi=300 and bbox_inches='tight' for publication-quality PNG output. Use PDF or SVG formats for scalable vector graphics in print publications.

Why do my matplotlib labels overlap or get cut off?

Overlapping happens when the default layout lacks spacing. Create the figure with constrained_layout=True, call tight_layout(), or save with bbox_inches='tight' to include all elements.

Which matplotlib colormap should I use for my data?

Use perceptually uniform sequential colormaps like viridis or cividis for ordered data, diverging maps like coolwarm for data centered on zero, and qualitative maps like tab10 for categories. Avoid jet, which is not perceptually uniform.