Seaborn

🧠 What is Seaborn

Statistical plotting library built directly on top of Matplotlib. Works natively with Pandas DataFrames, adds sensible defaults, and handles a lot of statistical aggregation (means, confidence intervals, regression lines) automatically.

MatplotlibSeaborn
InputRaw arraysDataFrames + column names (data=, x=, y=)
StatisticsManualBuilt-in (aggregation, CI, regression)
DefaultsMinimalPolished out of the box
ControlFull, low-levelHigh-level, less fine-grained (drop to matplotlib ax for that)

Seaborn plots return a matplotlib Axes (or Figure for grid functions) — use ax.set_...() / plt. calls on top for anything Seaborn doesn't expose directly. See Matplotlib for those.

📚 Map of Content

⚡ Minimal example

import seaborn as sns
import matplotlib.pyplot as plt
 
df = sns.load_dataset("tips")          # built-in sample datasets
sns.scatterplot(data=df, x="total_bill", y="tip", hue="time")
plt.show()
pip install seaborn