🚀
Seaborn
04 Comparison Plots
++++
Data Science
May 2026×Notebook lesson

Notebook converted from Jupyter for blog publishing.

04-Comparison-Plots

Driptanil Datta
Driptanil DattaSoftware Developer

Comparison Plots with pairplot() and jointplot()

Imports

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

The Data

df = pd.read_csv("StudentsPerformance.csv")
df.head()
HTML
MORE
gender
race/ethnicity
parental level of education
lunch
test preparation course

jointplot

sns.jointplot(x='math score',y='reading score',data=df)
RESULT
<seaborn.axisgrid.JointGrid at 0x23f9ed8dd08>
PLOT
Output 1
sns.jointplot(x='math score',y='reading score',data=df,kind='hex')
RESULT
<seaborn.axisgrid.JointGrid at 0x23fa1027308>
PLOT
Output 2
sns.jointplot(x='math score',y='reading score',data=df,kind='kde')
RESULT
<seaborn.axisgrid.JointGrid at 0x23fa11d4108>
PLOT
Output 3

pairplot

sns.pairplot(df)
RESULT
<seaborn.axisgrid.PairGrid at 0x23fa12eb608>
PLOT
Output 4
sns.pairplot(df,hue='gender',palette='viridis')
RESULT
<seaborn.axisgrid.PairGrid at 0x23fa18c8908>
PLOT
Output 5
sns.pairplot(df,hue='gender',palette='viridis',corner=True)
RESULT
<seaborn.axisgrid.PairGrid at 0x23fa1e07948>
PLOT
Output 6
sns.pairplot(df,hue='gender',palette='viridis',diag_kind='hist')
RESULT
<seaborn.axisgrid.PairGrid at 0x23fa190ef88>
PLOT
Output 7
Drip

Driptanil Datta

Software Developer

Building full-stack systems, one commit at a time. This blog is a centralized learning archive for developers.

Legal Notes
Disclaimer

The content provided on this blog is for educational and informational purposes only. While I strive for accuracy, all information is provided "as is" without any warranties of completeness, reliability, or accuracy. Any action you take upon the information found on this website is strictly at your own risk.

Copyright & IP

Certain technical content, interview questions, and datasets are curated from external educational sources to provide a centralized learning resource. Respect for original authorship is maintained; no copyright infringement is intended. All trademarks, logos, and brand names are the property of their respective owners.

System Operational

© 2026 Driptanil Datta. All rights reserved.