Skip to content

Scatter Plot Maker

Enter pairs of numbers to plot them as points. Add a line of best fit and see its equation and the correlation coefficient r.

Free, no sign-up · Last updated

Data

XYActions

Chart options

Chart colors

Numbers

Points (n)

8

Strong positive correlation

Mean x
4.5
Mean y
69.5
Slope
5.0238
Intercept
46.8929
Equation
y = 5.02x + 46.89
Pearson r
0.9953
r²
0.9907

Definition

What a scatter plot shows

A scatter plot shows paired numerical observations as points on two axes. Each point records both measurements from the same observation. The cloud of points can reveal patterns such as a linear trend, a curve, clusters or isolated values.

One point
One pair of measurements
Best-fit slope
Change in predicted y per unit of x
Pearson r
Strength and direction of a linear pattern

How to make a scatter plot

Each row is one person or thing with two measurements, such as one student’s hours of study and their test score. Type the pairs into the table, or paste two columns from Excel or Google Sheets into Paste text. The maker reads commas, tabs and spaces between the numbers and tells you about any row it could not read.

Label the axes with the variable name and units, such as Hours studied and Test score. The axes are scaled to fit your data. Turn on start at zero if you want both axes to begin at 0, which helps when comparing with another graph. Turn on the line of best fit to add the regression line, its equation and the r value to the chart.

Worked example: hours studied and test scores

Eight students recorded how many hours they studied and the score they got: (1, 52), (2, 58), (3, 61), (4, 68), (5, 71), (6, 75), (7, 83) and (8, 88). This is the example in the maker. The mean of x is 4.5 and the mean of y is 556 ÷ 8 = 69.5.

The sum of (x − x̄)(y − ȳ) is 211 and the sum of (x − x̄)² is 42, so the slope is 211 ÷ 42 ≈ 5.02 points per hour. The intercept is 69.5 − (211 ÷ 42) × 4.5 ≈ 46.89, which gives the line y = 5.02x + 46.89. The correlation is r ≈ 0.995, a very strong positive relationship. Using the line, a student who studied 9 hours would be predicted to score about 5.02 × 9 + 46.89 ≈ 92.

Describing what you see

Describe the direction, the form and the strength. The direction is positive if the points rise from left to right and negative if they fall. The form is linear if they follow a straight band, or curved if they bend. The strength is how tightly the points hug the pattern. Also point out any outlier that sits far from the rest, since a single unusual point can pull the line of best fit toward it.

The slope of the line has a plain meaning in context. In the example, each extra hour of study goes with about 5 more points. The intercept is the predicted y when x is 0, here about 47 points for no study. That only makes sense when x = 0 is close to the data you collected.

Scatter plot or line graph?

Use a scatter plot when each point is a separate case and the x values have no fixed order, such as students, cities or cars. Use a line graph when x is a steady sequence, usually time, and joining the points shows how one thing changes from one step to the next.

To find the slope between just two points, use the slope calculator. To graph an equation such as y = 5.02x + 46.89 on its own, use the graphing calculator.

Step-by-step example

Fit a line to the study-hour and test-score pairs (1, 52), (2, 58), (3, 61), (4, 68), (5, 71), (6, 75), (7, 83) and (8, 88).

StepResult
Mean hours studied4.5 hours
Mean score69.5 points
Fitted slope5.02 points per hour
Fitted intercept46.89 points
Pearson correlation0.995
Fitted score at 9 hoursAbout 92 points

The 9-hour prediction extends beyond the observed range of 1 to 8 hours.

Formulas used

Least-squares line and correlation

Slope b = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)²

Intercept a = ȳ − b × x̄, giving y = bx + a

r = Σ(x − x̄)(y − ȳ) ÷ √[Σ(x − x̄)² × Σ(y − ȳ)²]

x
horizontal coordinate of an observation
y
vertical coordinate or fitted value
x̄
mean of the x values
ȳ
mean of the y values
a
fitted intercept
b
fitted slope
r
Pearson correlation coefficient
Σ
sum over all points

Example: Hours vs. scores: Σ(x − x̄)(y − ȳ) = 211, Σ(x − x̄)² = 42 and Σ(y − ȳ)² = 1,070. Slope = 211 ÷ 42 ≈ 5.02, intercept = 69.5 − (211 ÷ 42) × 4.5 ≈ 46.89, and r = 211 ÷ √(42 × 1,070) ≈ 0.995.

When the answer can mislead

  • Overlapping dots can conceal repeated pairs.
  • A strong linear fit can still leave a consistent curve or separate groups in the plot.
  • Use the same axis limits when comparing how steep two plots look.

Questions

How do I make a scatter plot?

Enter one pair of numbers per line, x first and then y, separated by a comma, tab or space, for example 3, 61. You can also fill in the table or paste two columns from a spreadsheet. A heading row such as Hours, Score is skipped. Label both axes, choose the colors, turn on the line of best fit if you want it, and download or print the graph.

Which variable goes on the x-axis?

Put the variable you think explains or causes the other on the x-axis (the explanatory or independent variable) and the one that responds on the y-axis. In the example, hours studied goes along the bottom and test score goes up the side, because studying is expected to affect the score, not the other way around.

How is the line of best fit worked out?

The maker uses least-squares regression. It finds the straight line that makes the total of the squared vertical distances from the points to the line as small as possible. The slope is the sum of (x − x̄)(y − ȳ) divided by the sum of (x − x̄)², and the line always passes through the point (x̄, ȳ), the mean of x and the mean of y.

What does the r value mean?

r is the correlation coefficient. It runs from −1 to 1. Values near 1 mean a strong positive relationship, where y tends to rise as x rises. Values near −1 mean a strong negative one. Values near 0 mean no straight-line relationship. As a rough guide, a size above 0.7 is strong, 0.4 to 0.7 is moderate and below 0.4 is weak.

Does a strong correlation prove that one thing causes the other?

No. Two things can rise together because a third factor drives both, or simply by chance in a small sample. A scatter plot shows that a pattern exists. Whether one variable causes the other is a separate question, usually answered with a controlled experiment.

Can I use the line to make predictions?

Yes, within the range of your data. Put the x value into the equation to estimate y. Predicting far beyond the data, called extrapolation, is risky, because the pattern may not continue. A score predicted for 20 hours of study could come out above 100, which is impossible.

Last updated How we check
Embed this calculator
Cite this calculator

Scatter Plot Maker. CalculatorLab. https://calculatorlab.site/calculators/scatter-plot-maker/. Last updated .