Seaborn is a Python library for statistical data visualisation that provides high-level functions to create attractive and informative charts with minimal code [1].
It’s built on top of Matplotlib and integrates closely with pandas - making it easier to explore patterns and trends in tabular data.
Seaborn is commonly used to [2]:
import seaborn as sns
sns.set_theme(style = “darkgrid”)
After importing the Seaborn library, this sets a consistent background style (in this case, a dark grid) for all your Seaborn plots in the script or notebook.
import seaborn as sns
tips = sns.load_dataset(“tips”)
sns.histplot(data = tips, x = “total_bill”)
This draws a histogram of the total_bill column from the tips dataset so you can see how the bill amounts are distributed.
import seaborn as sns
tips = sns.load_dataset(“tips”)
sns.scatterplot(data = tips, x = “total_bill”, y = “tip”, hue = “smoker”)
This creates a scatter plot of total_bill vs tip with the tips dataset, using different colours (hue = “smoker”) to distinguish between smoker and non-smoker customers.