Joint Plot

Purpose

Combine scatter plot with marginal distributions (histograms or KDE) to show bivariate relationships and univariate distributions simultaneously.

Analysis Type

Bivariate with univariate margins

What to Look For

1. Central Scatter Plot
2. Marginal Distributions
3. Joint Distribution
4. Different Joint Plot Types

Code Example

# Example: Joint Plot using seaborn's tips dataset
import seaborn as sns
import matplotlib.pyplot as plt

# Load sample dataset
tips = sns.load_dataset('tips')

# Basic joint plot
sns.jointplot(x='total_bill', y='tip', data=tips)
plt.suptitle('Joint Plot of Total Bill vs Tip', y=1.02)
plt.show()

# Joint plot with regression
sns.jointplot(x='total_bill', y='tip', data=tips, kind='reg')
plt.suptitle("Joint Plot of Total Bill vs Tip (Regression)", y=1.02)
plt.show()

# Joint plot with KDE
sns.jointplot(x='total_bill', y='tip', data=tips, kind='kde')
plt.suptitle("Joint Plot of Total Bill vs Tip (KDE)", y=1.02)
plt.show()

# Hexbin for large datasets
sns.jointplot(x='total_bill', y='tip', data=tips, kind='hex')
plt.suptitle("Joint Plot of Total Bill vs Tip (Hexbin)", y=1.02)
plt.show()

ML_AI/_feature_engineering/images/joint-1.pngML_AI/_feature_engineering/images/joint-2.png
ML_AI/_feature_engineering/images/joint-3.pngML_AI/_feature_engineering/images/joint-4.png

Documentation