Skip to content
Skills Library
Data & analytics · Analysis

seaborn

/seaborn

Expert Seaborn statistical data visualization assistance covering statistical charts, categorical plots, heatmap matrices, and themes. Use when creating insightful statistical graphics and exploratory data analysis plots.

Licence
MIT
Last repository change
01.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 01.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Expert Seaborn statistical data visualization assistance covering statistical charts, categorical plots, heatmap matrices, and themes. Use when creating insightful statistical graphics and exploratory data analysis plots.

Original author description

Expert Seaborn statistical data visualization assistance covering statistical charts, categorical plots, heatmap matrices, and themes. Use when creating insightful statistical graphics and exploratory data analysis plots.

How it works

  1. When to Use
  2. Quick Start
  3. Core Concepts
  4. Common Patterns
  5. Best Practices
  6. Troubleshooting
  7. References
Original SKILL.md headings · 162 lines, 519 words
SKILL.md preview
---
name: seaborn
description: Expert Seaborn statistical data visualization assistance covering statistical charts, categorical plots, heatmap matrices, and themes. Use when creating insightful statistical graphics and exploratory data analysis plots.
---

# Seaborn

Seaborn is a high-level wrapper around Matplotlib. It makes **statistical plots** (violins, heatmaps, pairs) easy.

## When to Use

- **Statistical Data Visualization**: Producing clear distribution plots, regression curves, and correlation heatmaps.
- **Multi-Plot Categorical Comparisons**: Visualizing complex distributions with `boxplot`, `violinplot`, and `catplot`.
- **Modern Object Interface (sns.objects)**: Clean grammar of graphics visualization inspired by ggplot2.
- **Pairwise Feature Exploration**: Rapidly identifying variable correlations and cluster separations with `pairplot`.

## Quick Start

```python
import seaborn as sns
import matplotlib.pyplot as plt

# Load sample dataset and plot regression with confidence interval
tips = sns.load_dataset("tips")

plt.figure(figsize=(8, 5))
sns.set_theme(style="whitegrid")
sns.scatterplot(data=tips, x="total_bill", y="tip", hue="time", size="size")
plt.title("Tip Amount vs Total Bill by Dining Time")
plt.show()
```

## Core Concepts

### Modern Seaborn Objects Interface (sns.objects)

Grammar of graphics data visualization:

```python
import seaborn.objects as so
import seaborn as sns
import matplotlib.pyplot as plt

# Load sample dataset
penguins = sns.load_dataset("penguins").dropna()

# Declarative grammar of graphics plot
plot = (
    so.Plot(penguins, x="bill_length_mm", y="bill_depth_mm", color="species", pointsize="body_mass_g")
    .add(so.Dots(alpha=0.7))
    .add(so.Line(), so.PolyFit(order=1))
    .label(
        title="Penguin Bill Dimensions & Linear Fits",
        x="Bill Length (mm)",
        y="Bill Depth (mm)",
        color="Species"
    )
    .theme({"axes.grid": True})
)

fig = plt.figure(figsize=(9, 5))
plot.on(fig).save("seaborn_objects_plot.png")
```

### Statistical Distributions & Faceted Grids

Visualizing density and distributions across categories:

```python
import seaborn as sns
import matplotlib.pyplot as plt

sns.set_theme(style="whitegrid", palette="muted")
tips = sns.load_dataset("tips")

# Multi-panel faceted distribution
g = sns.displot(
    data=tips,
    x="total_bill",
    hue="time",
    col="day",
    kind="kde",
    fill=True,
    common_norm=False,
    palette="crest",
    height=3.5,
    aspect=0.8
)

g.set_axis_labels("Total Bill ($)", "Density")
g.savefig("tips_kde_faceted.png", bbox_inches="tight")
plt.close()
```

### Categorical Box and Violin Comparisons

Comparing distributions across discrete classes:

```python
fig, ax = plt.subplots(figsize=(8, 5))

sns.violinplot(
    data=tips,
    x="day",
    y="total_bill",
    hue="sex",
    split=True,
    inner="quart",
    palette={"Male": "#3b82f6", "Female": "#ec4899"},
    ax=ax
)

ax.set_title("Total Bill Distribution by Day & Gender")
plt.savefig("violin_comparison.png", bbox_inches="tight")
plt.close(fig)
```

## Common Patterns

### Correlation Heatmap with Masked Triangle

**Problem**: Large correlation heatmaps are visually redundant and cluttered when showing both upper and lower triangles.

**Solution**:
Mask upper triangle using NumPy:

```python
import numpy as np

corr = df.select_dtypes(include=np.number).corr()
mask = np.triu(np.ones_like(corr, dtype=bool))

plt.figure(figsize=(10, 8))
sns.heatmap(corr, mask=mask, cmap="vlag", vmax=1.0, vmin=-1.0,
            annot=True, fmt=".2f", square=True, linewidths=.5)
plt.title("Feature Correlation Matrix")
plt.show()
```

## Best Practices

**Do**:

- Adopt the new `seaborn.objects` (`so.Plot`) API for modern, composable grammar-of-graphics visualizations.
- Apply `sns.set_theme()` at application startup to configure consistent typography and aesthetic palettes.
- Pass tidy long-form DataFrames to Seaborn functions (`data=df, x='col1', y='col2', hue='category'`).
- Always close Matplotlib figures (`plt.close(fig)`) when generating charts in backend web pipelines.

**Don't**:

- Use pie charts for categorical proportions; use horizontal bar charts (`sns.barplot`).
- Overload charts with more than 4-5 categories in `hue`; use faceted subplots (`col='category'`) instead.
- Mix stateful `plt.title()` with object-oriented `ax.set_title()`.

## Troubleshooting

| Error                                                      | Cause                                            | Solution                                                       |
| :--------------------------------------------------------- | :----------------------------------------------- | :------------------------------------------------------------- |
| `TypeError: Object of type '...' is not JSON serializable` | Passing non-numeric columns to `heatmap()`.      | Filter numeric columns: `df.select_dtypes(include=np.number)`. |
| `Seaborn plot showing tiny unreadable fonts`               | Default scaling mismatch with high-DPI displays. | Set context scaling: `sns.set_context("talk")` or `"poster"`.  |
| `AttributeError: module 'seaborn' has no attribute '...'`  | Outdated Seaborn version installed.              | Upgrade Seaborn to 0.13+: `pip install --upgrade seaborn`.     |

## References

- [Seaborn Documentation](https://seaborn.pydata.org/)

Versions

RepositoryScoreLicence
This page · G1Joshi/Agent-Skills100MIT
FOURTEEN1416/academic-agent-toolkit100CC-BY-4.0
ekko8600/enzyme_design_harness100Apache-2.0
aipoch/medical-research-skills100MIT
lamm-mit/scienceclaw95Apache-2.0
LiHongwei-cn/lihongwei-cn95MIT
FreedomIntelligence/OpenClaw-Medical-Skills95BSD-3-Clause
bestagentkits/agency-skills95MIT
sandbaseai/sandbase-skills90Apache-2.0

Database snapshot: 13.11.2026 · package version 7803421caab6 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95seaborn-statistical-plots
    Statistical visualization on matplotlib with native pandas support. Auto aggregation, CIs, grouping for distributions (histplot, kdeplot), categorical (boxplot, violinplot), relational (scatterplot, lineplot), regression (regplot, lmplot), matrix (heatmap, clustermap), grids…
  • 100alterlab-seaborn
    Builds statistical plots with the seaborn Python library and pandas DataFrame integration, on attractive matplotlib-based defaults. Use for quick exploration of distributions, relationships, and categorical comparisons — box plots, violin plots, swarm/strip plots,…
  • 100data-visualization
    Create clear, effective charts and dashboards from structured data using matplotlib, seaborn, and plotly. Use when the user requests data visualization or provides relevant inputs for this workflow.
  • 100analytics-data-analysis
    Best practices for analytics, data analysis, and visualization using Python, pandas, matplotlib, seaborn, and Jupyter notebooks. Use when performing exploratory data analysis, building data pipelines, creating statistical visualizations, writing Jupyter notebooks, cleaning and…
  • 100matplotlib
    Low-level plotting library for full customization. Use when you need fine-grained control over every plot element, creating novel plot types, or integrating with specific scientific workflows. Export to PNG/PDF/SVG for publication. For quick statistical plots use seaborn; for…
  • 95bigdata-visualization
    Data visualization toolkit for big data teams. Includes Matplotlib, Seaborn, Plotly for static and interactive charts. Use when creating dashboards, reports, or exploring data visually.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.