Python Central HubSign in

Data Analytics with Python / Phase 6: Statistical Visualization with Seaborn

Joint Plots

Combine a relationship plot with distributions using jointplot for quick bivariate EDA.

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.

diagram Anatomy of a joint plot mermaid
A joint plot combines a center panel (the relationship) with two side panels (each variable's own distribution).

Joint plot (scatter + hist)

Python
import seaborn as sns
 
tips = sns.load_dataset("tips")
 
sns.jointplot(data=tips, x="total_bill", y="tip", kind="scatter")

Joint plot with KDE

Python
import seaborn as sns
 
tips = sns.load_dataset("tips")
 
sns.jointplot(data=tips, x="total_bill", y="tip", kind="kde", fill=True)

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:

sketch Scatter plot with marginal histograms p5.js
The center panel is the x-y relationship; the top and right strips are each variable's own histogram.

Tips

  • For large data, kind="hex" is useful to reduce overplotting.
  • Joint plots are figure-level, so customization is slightly different.

Check your understanding

quizCheck yourself
  1. What does a jointplot show besides the relationship between two variables?

    Show answer

    B — Marginal distributions along the top and right edges — The center shows the bivariate relationship and the edge strips show each variable on its own.

  2. Which kind is suggested for large data to reduce overplotting?

    Show answer

    D — kind="hex" — Hexagonal binning counts points per cell, so dense data stays readable.

  3. Why can you not easily place a jointplot inside an existing plt.subplots() grid?

    Show answer

    C — It is figure-level and manages its own figure — Figure-level functions such as jointplot, pairplot and lmplot create their own figure, unlike axes-level regplot or scatterplot.

  4. Which call draws a filled KDE joint plot of total_bill and tip?

    Show answer

    A — sns.jointplot(data=tips, x="total_bill", y="tip", kind="kde", fill=True) — kind="kde" swaps the scatter for density contours and fill=True shades them.

Next

Continue to Pair Plots to see every pairwise relationship across several variables at once.

🧪 Try It Yourself

Exercise 1 – A Basic Joint Plot

exerciseYour turn

Tab indents. Press Escape, then Tab, to leave the editor. Control plus Enter runs the code; Control plus Shift plus Enter submits it.

Output
Press Run to see what your code prints.

Exercise 2 – Switch the Center Panel to KDE

exerciseYour turn

Tab indents. Press Escape, then Tab, to leave the editor. Control plus Enter runs the code; Control plus Shift plus Enter submits it.

Output
Press Run to see what your code prints.

Exercise 3 – Reduce Overplotting With Hex

exerciseYour turn

Tab indents. Press Escape, then Tab, to leave the editor. Control plus Enter runs the code; Control plus Shift plus Enter submits it.

Output
Press Run to see what your code prints.

Was this page helpful?

Let us know how we did