Joint Plots
What is a joint plot?
Section titled “What is a joint plot?”A joint plot shows:
- A bivariate relationship (scatter/KDE/hex)
- Marginal distributions on the sides
It’s a compact EDA tool.
flowchart TD A["x, y columns"] --> B["Center panel:
scatter / KDE / hex"] A --> C["Top margin:
histogram of x"] A --> D["Right margin:
histogram of y"]
Joint plot (scatter + hist)
Section titled “Joint plot (scatter + hist)”import seaborn as sns
tips = sns.load_dataset("tips")
sns.jointplot(data=tips, x="total_bill", y="tip", kind="scatter")Joint plot with KDE
Section titled “Joint plot with KDE”import seaborn as sns
tips = sns.load_dataset("tips")
sns.jointplot(data=tips, x="total_bill", y="tip", kind="kde", fill=True)Visualize it
Section titled “Visualize it”The center shows how the two variables relate; the strips along the top and right edges show each variable’s own shape, on its own:
- For large data,
kind="hex"is useful to reduce overplotting. - Joint plots are figure-level, so customization is slightly different.
Continue to Pair Plots to see every pairwise relationship across several variables at once.
🧪 Try It Yourself
Section titled “🧪 Try It Yourself”Exercise 1 – A Basic Joint Plot
Section titled “Exercise 1 – A Basic Joint Plot”Exercise 2 – Switch the Center Panel to KDE
Section titled “Exercise 2 – Switch the Center Panel to KDE”Exercise 3 – Reduce Overplotting With Hex
Section titled “Exercise 3 – Reduce Overplotting With Hex”pch.coffeeTagline
pch.coffeeCtapch.feedbackHeading
pch.feedbackSubheading