# Seaborn Tutorial: A Guide to Statistical Charts in Python

> A Seaborn tutorial for Python covering which plot function to use, figure-level vs axes-level functions, heatmaps, FacetGrid, legends, themes and saving figures.

Source: https://www.pythoncharts.com/seaborn/seaborn-tutorial/ | Published: 2026-11-27 | Author: Alex Scott | Category: Seaborn | Tags: seaborn, guide, histplot, lineplot, heatmap, facetgrid

Seaborn draws statistical charts from a pandas DataFrame: pass `data=` and name the columns for `x`, `y` and `hue`, as in `sns.scatterplot(data=df, x="price", y="sales", hue="region")`. It is built on Matplotlib, so you can adjust the result with Matplotlib methods. These tutorials are grouped by task, and newer ones are written for Seaborn 0.13.

![Grid of twelve Seaborn charts: histogram, density, line, regression, pair plot, clustermap, heatmap, swarm plot, ridge plot, joint plot, count plot and themes](https://www.pythoncharts.com/seaborn/seaborn-tutorial/images/seaborn-tutorial-montage.png)

## Quick Example

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

df = pd.DataFrame({
    "week": list(range(1, 9)) * 2,
    "plan": ["Free"] * 8 + ["Paid"] * 8,
    "signups": [120, 132, 128, 151, 160, 158, 175, 190,
                40, 46, 55, 58, 71, 80, 86, 99],
})

sns.set_theme(style="whitegrid")
fig, ax = plt.subplots(figsize=(7, 4.5))
sns.lineplot(data=df, x="week", y="signups", hue="plan", marker="o", ax=ax)
ax.set_title("Weekly Signups by Plan")
plt.show()
```

![Seaborn line chart in which free signups rise from 120 to 190 and paid signups from 40 to 99 over eight weeks](https://www.pythoncharts.com/seaborn/seaborn-tutorial/images/seaborn-tutorial-quick-example.png)

## Where Should I Start With Seaborn?

| Step | Question | Tutorial |
|---|---|---|
| 1. Basics | What does Seaborn do? | [Intro to Seaborn](https://www.pythoncharts.com/seaborn/intro-to-seaborn/) |
| 2. Two kinds of function | Why is `ax=` or `figsize=` ignored? | [Figure-level vs axes-level functions](https://www.pythoncharts.com/seaborn/seaborn-figure-level-vs-axes-level/) |
| 3. Look | How do I change the style of every chart? | [set_theme, styles and contexts](https://www.pythoncharts.com/seaborn/seaborn-themes-set-theme/) |
| 4. Legend | How do I move it? | [sns.move_legend](https://www.pythoncharts.com/seaborn/seaborn-move-legend/) |
| 5. Export | How do I save a sharp image? | [High-resolution figures](https://www.pythoncharts.com/seaborn/seaborn-save-high-resolution-figures/) |

## Which Seaborn Plot Should I Use?

To choose by appearance, browse the [Python Chart Gallery](https://www.pythoncharts.com/chart-gallery/).

| To show | Function | Tutorial |
|---|---|---|
| One distribution | `sns.histplot`, `sns.displot` | [Histograms](https://www.pythoncharts.com/seaborn/seaborn-histplot-displot/) |
| Smoothed distributions | `sns.kdeplot` | [Density plots](https://www.pythoncharts.com/seaborn/seaborn-kdeplot-density/) |
| Many distributions stacked | `sns.FacetGrid` with `kdeplot` | [Ridge plots](https://www.pythoncharts.com/seaborn/seaborn-ridge-plot-joyplot/) |
| Distribution shape by group | `sns.violinplot` | [Violin plots](https://www.pythoncharts.com/seaborn/violin-plots-seaborn/) |
| Every point by group | `sns.swarmplot` | [Beeswarm plots](https://www.pythoncharts.com/seaborn/seaborn-beeswarm-plot/) |
| Points and a summary together | `sns.boxplot` and `sns.swarmplot` | [Box plot with swarm](https://www.pythoncharts.com/seaborn/seaborn-box-plot-swarm-overlay/) |
| Rows per category | `sns.countplot` | [Count plots](https://www.pythoncharts.com/seaborn/seaborn-countplot/) |
| A value by category and group | `sns.barplot(hue=...)` | [Grouped bars](https://www.pythoncharts.com/seaborn/seaborn-grouped-bar-charts/) |
| A trend over time | `sns.lineplot` | [Line plots](https://www.pythoncharts.com/seaborn/seaborn-lineplot/) |
| A fitted relationship | `sns.regplot`, `sns.lmplot` | [Regression plots](https://www.pythoncharts.com/seaborn/seaborn-regplot-lmplot/) |
| Two variables and their distributions | `sns.jointplot` | [Joint plots](https://www.pythoncharts.com/seaborn/seaborn-jointplot-bivariate-distributions/) |
| Every pair of columns | `sns.pairplot` | [Pair plots](https://www.pythoncharts.com/seaborn/seaborn-pairplot/) |
| A grid of values | `sns.heatmap` | [Heatmaps](https://www.pythoncharts.com/seaborn/heatmaps-seaborn/) |
| A grid with similar rows grouped | `sns.clustermap` | [Clustermaps](https://www.pythoncharts.com/seaborn/seaborn-clustermap/) |

## Customize Seaborn Charts

| You want to | Tutorial |
|---|---|
| Print values on bars | [Bar plot value labels](https://www.pythoncharts.com/seaborn/seaborn-bar-plot-value-labels/) |
| Reorder categories | [Category order](https://www.pythoncharts.com/seaborn/seaborn-order-x-axis-categories/) |
| Change or remove the shaded interval | [Confidence interval bands](https://www.pythoncharts.com/seaborn/seaborn-confidence-interval-bands/) |
| Use your own colors | [Custom color palettes](https://www.pythoncharts.com/seaborn/seaborn-custom-color-palettes/) |
| Annotate or mask heatmap cells | [Styling heatmaps](https://www.pythoncharts.com/seaborn/seaborn-style-heatmaps/) |

## Facets, Figure Size, and Titles

| You want to | Tutorial |
|---|---|
| Resize a `catplot` | [catplot size and aspect ratio](https://www.pythoncharts.com/seaborn/seaborn-catplot-aspect-ratio-figure-size/) |
| Title a grid and its panels | [FacetGrid titles](https://www.pythoncharts.com/seaborn/seaborn-facetgrid-titles/) |
| Rotate labels in a grid | [Rotate FacetGrid and pairplot labels](https://www.pythoncharts.com/seaborn/seaborn-rotate-labels-facetgrid-pairplot/) |

## Should I Use Seaborn, Matplotlib, or the Objects Interface?

| Choose | When |
|---|---|
| Seaborn functions | Your data is in a DataFrame and you want grouping, aggregation or intervals handled for you |
| [Matplotlib](https://www.pythoncharts.com/matplotlib/matplotlib-tutorial/) | You need precise control or a chart Seaborn doesn't provide |
| [`seaborn.objects`](https://www.pythoncharts.com/seaborn/seaborn-objects-interface/) | You like building a chart in layers of marks, stats and moves |
| [Plotly](https://www.pythoncharts.com/plotly/plotly-tutorial/) | Readers need to hover, zoom or filter |

## Common Seaborn Problems

| Problem | Fix | Details |
|---|---|---|
| `catplot` ignores `figsize` | Use `height` and `aspect` | [catplot size](https://www.pythoncharts.com/seaborn/seaborn-catplot-aspect-ratio-figure-size/) |
| A figure-level function ignores `ax=` | Use the axes-level version, such as `histplot` for `displot` | [Figure vs axes level](https://www.pythoncharts.com/seaborn/seaborn-figure-level-vs-axes-level/) |
| The legend covers the data | `sns.move_legend(ax, "upper left", bbox_to_anchor=(1, 1))` | [Move the legend](https://www.pythoncharts.com/seaborn/seaborn-move-legend/) |
| The grid title overlaps the panels | `g.figure.suptitle("Title", y=1.02)` | [FacetGrid titles](https://www.pythoncharts.com/seaborn/seaborn-facetgrid-titles/) |
| "Points cannot be placed" warning | Reduce `size`, widen the figure or use `stripplot` | [Beeswarm plots](https://www.pythoncharts.com/seaborn/seaborn-beeswarm-plot/) |
| The `ci` parameter is deprecated | Use `errorbar` | [Confidence bands](https://www.pythoncharts.com/seaborn/seaborn-confidence-interval-bands/) |

## Similar Topics

- [Matplotlib Tutorial: from first plot to polished chart](https://www.pythoncharts.com/matplotlib/matplotlib-tutorial/)
- [Plotly Tutorial: interactive charts](https://www.pythoncharts.com/plotly/plotly-tutorial/)
- [How to Make a Raincloud Plot in Python](https://www.pythoncharts.com/python/raincloud-plot-python/)
