Back to Skills

python-dataviz

verified

This skill should be used when the user asks to "create a plot", "make a chart", "visualize data", "create a heatmap", "make a scatter plot", "plot time series", "create publication figures", "customize plot styling", "use matplotlib", "use seaborn", or needs guidance on Python data visualization, statistical graphics, or figure export.

View on GitHub

Marketplace

oaps

tbhb/oaps

Plugin

oaps

development

Repository

tbhb/oaps
1stars

skills/python-dataviz/SKILL.md

Last Verified

January 20, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/tbhb/oaps/blob/main/skills/python-dataviz/SKILL.md -a claude-code --skill python-dataviz

Installation paths:

Claude
.claude/skills/python-dataviz/
Powered by add-skill CLI

Instructions

# Python Data Visualization

Python data visualization with matplotlib and seaborn for creating publication-quality figures, statistical graphics, and exploratory visualizations.

## When to use each library

**Matplotlib** is the foundational plotting library. Use it for:

- Fine-grained control over every plot element
- Custom layouts with GridSpec or subplot_mosaic
- 3D visualizations
- Animations
- Embedding plots in GUI applications
- When you need low-level customization

**Seaborn** builds on matplotlib for statistical visualization. Use it for:

- Statistical plots with automatic aggregation and confidence intervals
- Dataset-oriented plotting from DataFrames
- Faceted multi-panel figures (small multiples)
- Distribution visualization (KDE, histograms, violin plots)
- Correlation matrices and clustered heatmaps
- Publication-ready aesthetics with minimal code

**Combined approach**: Use seaborn for the main visualization, then customize with matplotlib.

## Core concepts

### Matplotlib hierarchy

1. **Figure** - Top-level container for all plot elements
2. **Axes** - Actual plotting area (one Figure can have multiple Axes)
3. **Artist** - Everything visible (lines, text, ticks, patches)
4. **Axis** - The x/y number lines with ticks and labels

### Two matplotlib interfaces

**Object-oriented interface (recommended)**:

```python
import matplotlib.pyplot as plt

fig, ax = plt.subplots(figsize=(10, 6))
ax.plot(x, y, linewidth=2, label='data')
ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.legend()
plt.savefig('figure.png', dpi=300, bbox_inches='tight')
```

**pyplot interface** (quick exploration only):

```python
plt.plot(x, y)
plt.xlabel('X Label')
plt.show()
```

Always use the object-oriented interface for production code.

### Seaborn function levels

**Axes-level functions** plot to a single matplotlib Axes:

- Accept `ax=` parameter for placement
- Return Axes object
- Examples: `scatterplot`, `histplot`, `boxplot`, `heatmap`

**Figure-level func

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
7717 chars