What Is an Overlapping Scatter Plot? How to Fix Overplotting
An overlapping scatter plot puts two or more groups on the same axes so you can compare them directly. The price is that points land on top of each other, and the picture can turn into one blob. This guide explains what overlapping scatter plots are, why overlap hides patterns, and five fixes you can apply today.
What is an overlapping scatter plot?
A scatter plot draws one point per observation, with a predictor on the X axis and an outcome on the Y axis. In an overlapping scatter, each group (for example control, treatment A and treatment B) gets its own colour on the same axes. Where groups share similar values, their points overlap. The same happens inside a single group when many cases have identical or rounded values.
The technical name for points hiding other points is overplotting. It matters because the eye cannot count points that are stacked, so dense regions look the same as sparse ones.
What is it called when two circles overlap?
In geometry, the shared region of two overlapping circles is called their intersection, or a lens because of its shape. Drawing circles that overlap to show shared membership is a Venn diagram. In a scatter plot, circular markers that cover each other are not a Venn diagram. They are an overplotting problem, and the fixes below apply.
Five ways to fix overlapping points
1. Use transparency (alpha)
Set opacity between 0.2 and 0.6. Where several points stack, the colour deepens, so density becomes visible. Start near 0.5 for a few hundred points and go lower as the data grow.
2. Make the points smaller
Large markers create overlap by themselves. Reduce size until single points are still visible. For tens of thousands of points, very small markers combined with low opacity work best.
3. Add jitter to rounded or tied values
Ages in whole years, Likert scores and rounded measurements stack exactly. Add small random noise, about 1–3% of the axis range, to the displayed position only. Never use jittered values in your statistics.
4. Draw regression lines and confidence bands per group
A fitted line per group summarises each trend even when the clouds mix. A 95% confidence band shows how certain the trend is. Crossing lines suggest that the effect of the predictor differs between groups.
5. Report n and correlation for every group
Put the sample size and Pearson r next to each group name. Readers can then judge how much weight each cloud deserves. A tight line from 12 points is weaker evidence than a loose one from 1,200.
Plotly scatter overlapping points: code example
With Plotly Express, use opacity, a smaller marker size and a trendline per colour group. The trendline option needs the statsmodels package.
import numpy as np
import plotly.express as px
rng = np.random.default_rng(1)
df["Predictor_j"] = df["Predictor"] + rng.normal(0, 0.3, len(df)) # display only
fig = px.scatter(df, x="Predictor_j", y="Outcome", color="Group",
opacity=0.45, trendline="ols")
fig.update_traces(marker=dict(size=7), selector=dict(mode="markers"))
fig.show()
For more than about 50,000 points, switch to px.scatter with render_mode="webgl".
Matplotlib scatter overlapping points: code example
In Matplotlib, control overlap with alpha, s and linewidths.
import numpy as np
import matplotlib.pyplot as plt
rng = np.random.default_rng(1)
fig, ax = plt.subplots(figsize=(8, 5.6))
for name, d in df.groupby("Group"):
ax.scatter(d["Predictor"] + rng.normal(0, 0.3, len(d)), d["Outcome"],
s=18, alpha=0.45, linewidths=0, label=name)
b, a = np.polyfit(d["Predictor"], d["Outcome"], 1)
xs = np.array([d["Predictor"].min(), d["Predictor"].max()])
ax.plot(xs, a + b * xs, lw=2)
ax.legend(title="Group")
fig.savefig("scatter.png", dpi=300)
Prefer no code? The free StatFAS overlapping scatter plot generator applies all five fixes with sliders and exports 300 and 600 DPI figures, SVG and PDF.
Overlapping scale: keep axes comparable
When you compare several plots, give them the same scale on both axes. Different axis ranges make the same overlap look bigger or smaller. If two groups were measured on different scales, standardise them first, or plot them in separate panels with shared axes. Avoid truncating an axis just to pull the clouds apart, because it exaggerates differences.
What is positive overlapping?
“Positive overlapping” is not a standard statistical term, so its meaning depends on context. In scatter plots, people usually mean groups that overlap in range while each group shows a positive correlation, meaning Y rises as X rises. In that case the groups can look like one cloud, yet separate regression lines may still reveal different slopes or intercepts. Check the per-group r and the line for each group before you conclude that the groups behave alike.
When a scatter plot is not enough
| Situation | Better option |
|---|---|
| More than 100,000 points | Hexbin or 2D density plot |
| More than 10 groups | Small multiples, one panel per group |
| One variable only | Histogram, density or box plot |
| Overlap of two sets of items, not measurements | Venn or UpSet diagram |
Frequently asked questions
What is an overlapping scatter plot?
A scatter plot that shows two or more groups on the same axes, where points from different groups or with repeated values fall in the same area and hide one another.
What is it called when two circles overlap?
The shared region is the intersection or lens, and the diagram is a Venn diagram. Points hiding each other in a scatter plot are called overplotting.
How do I show overlapping points in Plotly?
Use an opacity below 1, a smaller marker size, a small jitter on the displayed values and one trendline per colour group.
How do I show overlapping points in Matplotlib?
Use alpha, a small s, linewidths=0 and optional jitter for rounded values.
Does jitter change my results?
Not if you jitter only the plotted coordinates. Always compute statistics from the original data.
Make your own overlapping scatter plot Browse all guides