Menu

Data Visualization with Seaborn

Data Visualization with Seaborn

Seaborn is a Python library built on top of Matplotlib that makes creating attractive, detailed statistical charts easier with less code.

Creating a Scatter Plot

Seaborn scatter plots automatically add useful styling and can show extra information with colour.

import seaborn as sns

import pandas as pd



data = pd.DataFrame({

    "Age": [22, 25, 30, 35, 40],

    "Salary": [30000, 35000, 45000, 50000, 60000]

})



sns.scatterplot(x="Age", y="Salary", data=data)

Creating a Histogram with Distribution

Seaborn can show both the histogram and the distribution curve together, which helps you understand data spread more clearly.

sns.histplot(data["Salary"], kde=True)

Creating a Box Plot

Box plots help you spot outliers and understand how data spreads across quartiles.

sns.boxplot(x=data["Salary"])

Creating a Correlation Heatmap

Heatmaps show how strongly different features in a dataset relate to each other, which is useful before selecting features for a model.

correlation = data.corr()

sns.heatmap(correlation, annot=True, cmap="coolwarm")

Creating a Pair Plot

Pair plots show relationships between every pair of numerical columns in a dataset, all in one view.

sns.pairplot(data)

Seaborn makes it easier to spot patterns, outliers, and relationships in data visually, which helps you make better decisions during feature engineering and model building.


Machine Learning Tutorial

AP

Abhishek Pati



Learn via Video Course

Artificial Intelligence and Machine Learning Course Logo

Artificial Intelligence and Machine Learning Course

55 hrs



Get in Touch For Details