Alterlab seaborn
Skill AlterLab-IEU/AlterLab-Academic-Skills/skills/visualization/alterlab-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, KDE/histograms, pair plots, joint plots, regression plots, correlation heatmaps, and faceted small multiples (relplot/displot/catplot/lmplot). For interactive/hover/zoom charts defer to alterlab-plotly; for exact journal/manuscript styling (column widths, point fonts, CMYK, vector export) defer to alterlab-scientific-viz; for low-level custom matplotlib figures defer to alterlab-matplotlib (seaborn integrates with it for fine-tuning). Part of the AlterLab Academic Skills suite.From its SKILL.md
npx -y skills add AlterLab-IEU/AlterLab-Academic-Skills --skill alterlab-seabornAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
6.4 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it
Seaborn Statistical Visualization
Overview
Seaborn is a Python visualization library for creating publication-quality statistical graphics. Use this skill for dataset-oriented plotting, multivariate analysis, automatic statistical estimation, and complex multi-panel figures with minimal code.
When to Use This Skill
Use seaborn for quick, attractive statistical graphics straight from a pandas DataFrame: distributions, relationships, categorical comparisons, correlation heatmaps, and faceted small multiples. Route elsewhere when the need differs:
- Interactive charts (hover, zoom, HTML dashboards) →
alterlab-plotly - Exact journal/manuscript styling (column widths, point fonts, CMYK, vector export) →
alterlab-scientific-viz - Low-level custom plotting →
alterlab-matplotlib(seaborn integrates with it for fine-tuning)
Design Philosophy
- Dataset-oriented — work directly with DataFrames and named variables, not abstract coordinates.
- Semantic mapping — automatically translate data values into visual properties (color, size, style).
- Statistical awareness — built-in aggregation, error estimation, and confidence intervals.
- Aesthetic defaults — publication-ready themes and palettes out of the box.
- Matplotlib integration — full compatibility with matplotlib customization when needed.
Quick Start
Examples target seaborn ≥ 0.13 (verified on 0.13.2). Two API points that bite on this version: pass palette= only together with hue= (palette-without-hue is deprecated, removed in 0.14), and style error bars via err_kws={...} rather than the removed-in-0.15 errcolor/errwidth/scale/join keywords.
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
df = sns.load_dataset('tips')
sns.scatterplot(data=df, x='total_bill', y='tip', hue='day')
plt.show()
Core Workflow
- Shape the data as long-form ("tidy") — one column per variable, one row per observation. This works with every seaborn function. Reshape wide data with
df.melt(...). Seereferences/data_palettes_theming.md. - Pick the plot category for your variable types (see routing below).
- Encode extra dimensions with
hue,size,stylesemantic mappings. - Choose axes-level vs figure-level: axes-level (
scatterplot,boxplot,heatmap, …) plug into custom matplotlib layouts viaax=; figure-level (relplot,displot,catplot,lmplot, …) own the whole figure and facet viacol/row. - Theme and save with
set_theme/set_contextandsavefig(dpi=300, bbox_inches='tight')(PDF for vector).
Plot Category Routing
Choose the category, then see references/plotting_functions.md for parameters and code for each.
| Goal | Category | Key functions |
|---|---|---|
| How variables relate | Relational | scatterplot, lineplot, relplot |
| Spread / shape / density | Distribution | histplot, kdeplot, ecdfplot, displot, jointplot, pairplot |
| Compare across categories | Categorical | stripplot, swarmplot, boxplot, violinplot, barplot, pointplot, countplot, catplot |
| Linear relationships / residuals | Regression | regplot, lmplot, residplot |
| Matrices / correlations | Matrix | heatmap, clustermap |
| Custom multi-panel grids | Grids | FacetGrid, PairGrid, JointGrid |
The modern declarative seaborn.objects interface (ggplot2-like, composable) is best for complex layered or programmatic plots — see references/objects_interface.md.
Color and Theming (essentials)
- Qualitative palettes for categories (
"colorblind","deep","muted"); sequential for ordered data ("rocket","viridis"); diverging for centered data ("vlag","coolwarm", withcenter=0). set_theme(style=..., context=..., palette=...); styleswhitegrid/ticks/…; contextspaper→talk→posterscale element sizes.
Full palette and theming reference: references/data_palettes_theming.md.
Best Practices (essentials)
- Plot from named DataFrame columns (preserves axis labels); use figure-level functions for faceting; encode extra dimensions with
hue/size/style. - Know what each function estimates:
lineplot/barplotauto-compute mean + CI — override witherrorbar=andestimator=. - Combine with matplotlib (
ax.set(...),axhline,tight_layout) for fine-tuning; save atdpi=300, and PDF for publications.
Full best-practices, common patterns, and troubleshooting (legend placement, overlapping labels, figure sizing, palette distinctness, KDE bandwidth): references/best_practices_and_troubleshooting.md.
Reference Index
references/plotting_functions.md— every plot category with parameters and code (relational, distribution, categorical, regression, matrix, multi-plot grids, figure-vs-axes-level).references/data_palettes_theming.md— long/wide data structure, color palettes (qualitative/sequential/diverging/custom), and theming (set_theme, styles, contexts).references/best_practices_and_troubleshooting.md— best practices, common patterns (EDA, publication figures, multi-panel, time series), and troubleshooting.references/function_reference.md— comprehensive function signatures, parameters, and examples.references/objects_interface.md— detailed guide to the modernseaborn.objectsAPI.references/examples.md— scenario-based worked examples and code patterns.
What ships with it: 7 files
79.5 KB alongside SKILL.md
evals/
- evals.json4.0 KB
references/
- best_practices_and_troubleshooting.md4.3 KB
- data_palettes_theming.md2.4 KB
- examples.md17.4 KB
- function_reference.md24.4 KB
- objects_interface.md20.3 KB
- plotting_functions.md6.5 KB
Gives 0 of the 12 instructions most data analysis skills give in ~1.3k tokens
Counted across 230 of the 242 authors here whose files we hold, read 2026-09-06
- Propose a regression test for each fixed bugin 16 of 230, across 12 files
- Name tests after the bug they preventin 14 of 230, across 10 files
- Test the API response shape, not the implementationin 14 of 230, across 10 files
- Run the test suite before any code reviewin 14 of 230, across 10 files
- Force sandbox mode in the test setupin 14 of 230, across 10 files
- Write regression tests only for bugs already foundin 14 of 230, across 10 files
- Assert sandbox and production paths return the same shapein 14 of 230, across 10 files
- Clear stale state when setting an errorin 13 of 230, across 9 files
- Keep the whole test suite under one secondin 10 of 230, across 6 files
- Run the build type check before code reviewin 10 of 230, across 6 files
- Use vectorized operations instead of row iterationin 9 of 230, across 6 files
- Start bar chart Y-axes at zeroin 8 of 230, across 7 files
Said here and by no other author read
- Shape data as tidy long-form DataFrames
- Choose axes-level or figure-level functions per layout need
- Theme figures with set_theme and set_context
- Plot from named DataFrame columns
- Pass palette only together with hue
- Style error bars via err_kws
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.