agentleFS
G1JoshiG1Joshi/Agent-Skills/skills/ai-ml/seaborn/SKILL.md

seaborn

Skill15 starsChanged 45 days agoMITView on GitHub

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.

  • Installs packages

18 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use usfiscaldata, simpy and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • yf8578Skill

    usfiscaldata

    Query the U.S. Treasury Fiscal Data API for federal financial data including national debt, government spending, revenue, interest rates, exchange rates, and savings bonds. Access 54 datasets and 182 data tables with no API key required. Use when working with U.S. federal fiscal data, national debt tracking (Debt to the Penny), Daily Treasury Statements, Monthly Treasury Statements, Treasury securities auctions, interest rates on Treasury securities, foreign exchange rates, savings bonds, or any U.S. government financial statistics.

    Also in 7 projects that use this

  • tondevrelSkill

    simpy

    A process-based discrete-event simulation framework. Use for modeling queuing systems, supply chains, manufacturing processes, network simulation, project management, and any system where events occur at specific points in time. Load when working with discrete event simulation, process modeling, resource allocation, virtual time, simpy.Environment, simpy.Resource, or event-driven simulation.

    Also in 9 projects that use this

  • garri333Skill

    deeptools

    NGS analysis toolkit. BAM to bigWig conversion, QC (correlation, PCA, fingerprints), heatmaps/profiles (TSS, peaks), for ChIP-seq, RNA-seq, ATAC-seq visualization.

    Also in 10 projects that use this

  • garri333Skill

    dnanexus-integration

    DNAnexus cloud genomics platform. Build apps/applets, manage data (upload/download), dxpy Python SDK, run workflows, FASTQ/BAM/VCF, for genomics pipeline development and execution.

    Also in 10 projects that use this

  • tondevrelSkill

    scikit-bio

    Library for bioinformatics and community ecology statistics. Provides data structures and algorithms for sequences, alignments, phylogenetics, and diversity analysis. Essential for microbiome research and ecological data science. Use for alpha/beta diversity metrics, ordination (PCoA), phylogenetic trees, sequence manipulation (DNA/RNA/Protein), distance matrices, PERMANOVA, and community ecology analysis.

    Also in 10 projects that use this

  • Hongyu-yuSkill

    torch-geometric

    Graph Neural Networks (PyG). Node/graph classification, link prediction, GCN, GAT, GraphSAGE, heterogeneous graphs, molecular property prediction, for geometric deep learning.

    Also in 10 projects that use this

  • +5 more from garri333
  • +1 more from tondevrel

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 18 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always close Matplotlib figures (plt.close(fig)) when generating charts in backend web pipelines.

    line 147
  2. Very specific:

    Use pie charts for categorical proportions.

    line 151

“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

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:

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:

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:

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:

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

ErrorCauseSolution
TypeError: Object of type '...' is not JSON serializablePassing non-numeric columns to heatmap().Filter numeric columns: df.select_dtypes(include=np.number).
Seaborn plot showing tiny unreadable fontsDefault 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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.