You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Seaborn is a Python data visualisation library built on top of Matplotlib. It provides a high-level interface for drawing attractive, informative statistical graphics with less code. Seaborn integrates closely with Pandas DataFrames and includes built-in themes, colour palettes, and functions for common statistical visualisations.
pip install seaborn
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
# Set the default theme
sns.set_theme(style="whitegrid")
| Feature | Matplotlib | Seaborn |
|---|---|---|
| Level of abstraction | Low-level — you control every element | High-level — sensible defaults |
| Code verbosity | More code for styled plots | Less code for attractive plots |
| Statistical features | Manual | Built-in (confidence intervals, regression lines) |
| DataFrame integration | Requires manual column access | Native support for column names |
| Customisation | Unlimited | Customise via Matplotlib underneath |
Seaborn comes with several built-in datasets for practice:
# List available datasets
print(sns.get_dataset_names())
# Load a dataset
tips = sns.load_dataset("tips")
print(tips.head())
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.