Skip to content
Graph Craft

Scatter + Marginal Histogram

FacebookX
Example: Age × loan limit of customersApache ECharts

Variant: Standard

Made-up data, for demonstration only

Variants

4 types · click one to see it in the frame above
Difference from standard
The recommended type; use it as a starting point
Use when
See the relationship between two variables along with the distribution of each

Scatter + Marginal Histogram is a scatter plot of two variables with a histogram added on the top and on the right. It shows both the relationship between the two variables and the distribution of each in one picture, such as customer age against credit limit.

How to read a Scatter + Marginal Histogram

  • One dot is one customer. This example has 160 customers. The horizontal axis is age (20 to 65 years) and the vertical axis is credit limit in thousands of dollars (made-up data).
  • The dots climb to the right. As age rises, the limit tends to rise. The correlation is about 0.58, a moderate positive relationship. Not everyone follows the trend.
  • The histogram on top is the distribution of age. Most customers are 30 to 45 years old, with a mean of about 38.
  • The histogram on the right is the distribution of the limit. It bunches at low limits with a long tail toward high ones. The mean is about $163K.
  • The high-limit group is small. Only 7 customers (about 4%) have a limit of $300K or more. There are 31 customers under 30, with an average limit of about $108K, and 16 aged 50 or over, averaging about $275K.

The marginal histograms show which parts of the main chart hold a lot of data, which a scatter plot alone often cannot show when the dots overlap.

When to use it

  • You want to see the relationship between two variables. A scatter plot is used to study how two variables relate, and often comes with a correlation value.
  • You also want the distribution of each variable. Marginal distributions add insight because you see the distribution of both variables.
  • The number of dots is still manageable. The dots do not overlap too much and the marginal histograms stay readable.

When not to use it

  • There is so much data that dots overlap. Try making the dots fainter, or use a Heatmap or a two-dimensional density plot.
  • One variable is a category, not a number. Use a Box Plot or a Strip Plot.
  • A third variable matters. Use the size or colour of the dots, but not so much that it becomes unreadable.
  • You want a conclusion about cause and effect. The chart shows only a relationship.

Common mistakes

1. Overlapping dots

With many dots, they hide each other and you cannot see the density. Try the "Fainter points" variant, which lowers the opacity. The marginal histograms help show where the dense parts are.

2. Forgetting to split into subgroups

If there are subgroups, show them, because they can hide an important pattern, such as Simpson's paradox, where the relationship inside each subgroup is the opposite of the overall one.

3. Not highlighting the group that is the point

Try the "Highlight high-limit group" variant, where the 7 customers with a limit of $300K or more are coloured and the rest are grey.

4. Reading correlation as cause

Older customers having higher limits does not mean age causes the limit. Income or payment history may be a shared factor.

5. No axis names and units

Readers need to know the vertical axis is in thousands of dollars. This example labels the axes "Credit limit ($K)" and "Age".

Compared with similar charts

ChartHow it differsChoose it when
Scatter + MarginalA scatter plot with the distribution on the marginsThe relationship and the distribution of each variable
HistogramThe distribution of one variableYou have one variable
HeatmapColour by densitySo much data that the dots overlap
Density PlotA smooth curve of one variableA smooth distribution shape
Box PlotA summary by groupOne variable is a category

Frequently asked questions

What do the marginal histograms add?

They show where the data bunch along each axis, which helps you read a scatter plot whose dots overlap.

Can I use a density curve instead of a histogram?

Yes, use a smooth curve on the margins instead of bars. With little data, though, a smooth curve can mislead.

What does a correlation of 0.58 mean?

The two variables move in the same direction to a moderate degree. Not everyone follows it, and it does not say one variable causes the other.

What is the minimum limit of 20 in the chart?

The sample data set the lowest value at $20K, so some customers (7 of 160) sit exactly at the lower edge.

References

  • Scatter plot · Data to Viz · www.data-to-viz.comUsed to confirm: how to read a scatter plot and what to watch for

Last updated 28 Nov 2026