Skip to content
Statculator
Charts & Graphs

Scatter Plot Maker

Free scatter plot maker: plot x and y data, colour points by group and add the line of best fit with its equation, r and R². Download as PNG or SVG.

Free, no sign-up Runs in your browserBy Hira Noor, BS MathematicsUpdated

Try
Data (x, y pairs)
#xyGroupRemove row
1
2
3
4
5
6
7
8
9
10
Tip: paste rows straight from a spreadsheet.

One point per row. Paste two or three columns from a spreadsheet to fill many rows at once. Add a group name to colour the points by group.

Results

Scatter plot of 10 points with fitted line5055606570758085y12345678x(1, 52)(2, 58)(2.5, 55)(3, 63)(4, 61)(4.5, 70)(5, 66)(6, 77)(7, 72)(8, 84)ŷ = 47.6853 + 4.2127x
Solid line: least-squares trend line for all points, drawn across the range of the x-axis.
Correlation, r
0.9422
very strong, positive
Coefficient of determination, R²
0.8877
Trend line
ŷ = 47.6853 + 4.2127x
Number of points, n
10
Slope, b₁
4.2127
Intercept, b₀
47.6853
Mean of x, x̄
4.3
Mean of y, ȳ
65.8
Standard error of estimate, sₑ
3.5766
x range
1 to 8
y range
52 to 84

Interpretation: The points show a very strong positive linear relationship (r = 0.9422). On the trend line, each one-unit increase in x goes with a change of 4.2127 in y, and the line explains 88.77% of the variation in y.

Points and fitted values

#xyŷResidual, y − ŷ
115251.8980.102
225856.11071.8893
32.55558.2171-3.2171
436360.32352.6765
546164.5362-3.5362
64.57066.64253.3575
756668.7489-2.7489
867772.96164.0384
977277.1743-5.1743
1088481.38712.6129

Residuals are the vertical distances from each point to the trend line; least squares makes the sum of their squares as small as possible.

Step-by-step solution

  1. 1

    Find the means of x and y

    x̄ = Σx / n = 43 / 10 = 4.3
    ȳ = Σy / n = 658 / 10 = 65.8
  2. 2

    Compute the sums of squares and cross-products

    Sxx = Σ(x − x̄)² = 45.6
    Syy = Σ(y − ȳ)² = 911.6
    Sxy = Σ(x − x̄)(y − ȳ) = 192.1
  3. 3

    Find the slope of the least-squares line

    b₁ = Sxy / Sxx = 192.1 / 45.6 = 4.2127
  4. 4

    Find the intercept

    b₀ = ȳ − b₁x̄ = 65.8 − 4.2127 × 4.3 = 47.6853
    ŷ = 47.6853 + 4.2127x
  5. 5

    Measure the strength of the linear pattern

    r = Sxy / √(Sxx · Syy) = 192.1 / √(45.6 × 911.6) = 0.9422
    R² = r² = 0.8877
  6. 6

    Plot the points and the line

    Each (x, y) pair becomes one dot; the trend line is drawn from ŷ at the left edge of the axis to ŷ at the right edge.

What is a Scatter Plot maker?

A scatter plot maker turns pairs of numbers into a scatter graph: one dot per (x, y) pair, with x on the horizontal axis and y on the vertical axis, so you can see whether the two variables move together. This one also draws the line of best fit, gives its equation ŷ = b₀ + b₁x with the correlation r and R², and can colour the points by group.

What the Scatter Plot Maker does

Type or paste paired data and this free scatter plot generator plots the points, fits the line of best fit by ordinary least squares, and reports the slope, intercept, correlation r, R² and standard error of the estimate. A table lists each point’s fitted value and residual, and points that sit unusually far from the line are highlighted. Add a title and axis labels, then download the chart as PNG or SVG.

It makes a scatter graph with a line of best fit in one step, so you do not need a separate regression tool or a graphing calculator for the trend line. People also call it a scatter plot calculator, scatterplot creator, scatter diagram generator, correlation graph generator or line of best fit graph maker: they all mean the same chart.

Fill in the optional Group column to colour the dots by category, for example two classes, two regions or a treatment and a control. Tick the per-group option to draw a separate dashed trend line for each group, with its own r and slope in a comparison table. That is how you make a scatter plot with multiple lines and compare the relationship across groups on one chart.

How to use the Scatter Plot Maker

  1. Enter one point per row under Data (x, y pairs): the explanatory variable in x and the response in y. You can paste two columns straight from Excel or Google Sheets.
  2. To compare groups, type a name in the optional Group column (or paste it as a third column). Rows with the same name share a colour.
  3. Leave Show trend line (least squares) ticked to overlay the line of best fit for all points, or untick it for points only. Tick Add a separate trend line for each group to draw one line per group.
  4. Add a Chart title, X-axis label and Y-axis label so the downloaded chart explains itself.
  5. Read r, R² and the trend-line equation in the results, then check the residual table and the step-by-step working before you download the chart.

When to use a scatter plot

Use a scatter plot when you have two numeric measurements on each subject and want to know whether they are related: hours studied and exam score for each student, advertising spend and sales for each month, or height and weight for each person. Each subject gives one dot, so the data must come in pairs.

Choose a different chart when the data do not fit that shape. For one numeric variable on its own, a histogram or box plot shows the distribution better. For counts in categories, use a bar graph. For one measurement tracked over time, a line graph that joins the points in time order is clearer than a cloud of dots.

Line of best fit and correlation formulas

Least-squares slope and intercept
b₁ = Sxy / Sxx b₀ = ȳ − b₁x̄
Pearson correlation coefficient
r = Sxy / √(Sxx · Syy)
Sums of squares
Sxx = Σ(x − x̄)² Syy = Σ(y − ȳ)² Sxy = Σ(x − x̄)(y − ȳ)
Formula symbols
SymbolMeaning
ŷvalue of y predicted by the trend line
b₁slope: change in ŷ for a one-unit increase in x
b₀intercept: ŷ when x = 0
rcorrelation, from −1 (perfect negative) to +1 (perfect positive)
R²share of the variation in y explained by the line (equals r² for a straight line)

The least-squares line always passes through the point (x̄, ȳ), and its residuals sum to zero. The same formulas give each group’s line when you fit the groups separately.

These are the same ordinary least-squares formulas behind Excel’s SLOPE, INTERCEPT, CORREL and RSQ functions and its linear trendline, so the equation, r and R² here match what a spreadsheet reports for the same data.

Worked example

Worked example: study time and exam score

Problem. Ten students report hours studied (x) and exam score (y): (1, 52), (2, 58), (2.5, 55), (3, 63), (4, 61), (4.5, 70), (5, 66), (6, 77), (7, 72), (8, 84). These are the default values above. Find the line of best fit and r.

  1. 01Means: x̄ = 43 / 10 = 4.3 and ȳ = 658 / 10 = 65.8.
  2. 02Sums of squares: Sxx = 45.6, Syy = 911.6 and Sxy = 192.1.
  3. 03Slope: b₁ = 192.1 / 45.6 = 4.2127. Intercept: b₀ = 65.8 − 4.2127 × 4.3 = 47.6853.
  4. 04Correlation: r = 192.1 / √(45.6 × 911.6) = 0.9422, so R² = 0.8877.

Answer. The line of best fit is ŷ = 47.6853 + 4.2127x. Each extra hour of study goes with about 4.2 more points, and the line explains about 88.8% of the variation in scores (r = 0.9422, a very strong positive relationship).

What to look for in a scatter plot

Describe a scatter plot with four features before quoting any number: direction, form, strength and unusual points. The table shows the common patterns and what each one means for r and the line of best fit.

  • Strength: how tightly the points hug the line. As a rough guide, |r| below 0.2 is very weak, 0.2–0.4 weak, 0.4–0.6 moderate, 0.6–0.8 strong and above 0.8 very strong.
  • Is r significant? Compare |r| with the critical values of r table for your sample size, or run the Pearson’s Correlation Test Calculator for a p-value.
PatternWhat the dots look likeWhat it means
Positive correlationDots rise from lower left to upper rightLarger x goes with larger y. The slope b₁ and r are both positive.
Negative correlationDots fall from upper left to lower rightLarger x goes with smaller y. The slope and r are both negative.
No correlationA round or shapeless cloud with no tiltr is close to 0 and the line of best fit is nearly flat. x tells you little about y.
Curved (non-linear)Dots follow a bend, such as a U shape or a curve that levels offA straight line is the wrong model and r understates the relationship. Try the Quadratic Regression Calculator or Exponential Regression Calculator.
ClustersTwo or more separate clumps of dotsThe data may mix different groups. Label them in the Group column and compare the per-group lines.
OutlierOne dot far from the pattern of the restA single point can pull the line and change r a lot. This tool highlights points with a standardized residual beyond ±2.

How to make a scatter plot in Excel or Google Sheets

The steps below give the same chart and line of best fit as this tool. To skip them, copy your two columns from the spreadsheet and paste them into the data table above.

  • Excel: select the two columns with x on the left, choose Insert → Scatter (X, Y), then click any point, choose Add Trendline → Linear and tick Display Equation on chart and Display R-squared value on chart.
  • Google Sheets: select the two columns, choose Insert → Chart, set the chart type to Scatter chart, then under Customize → Series tick Trendline and set the label to Use equation.
  • By hand: draw and label both axes with evenly spaced scales that cover the smallest and largest values, plot one dot per pair, then sketch a line through (x̄, ȳ) with slope b₁ from the formula below.

Common use cases

  • Exploring a relationship before running a correlation or regression analysis.
  • Comparing groups: plot two classes, regions or treatments on one chart and compare their per-group slopes.
  • Business: plot advertising spend against sales, or price against units sold, to see if a trend exists.
  • Science labs and homework: graph a measured response against a controlled variable and add the line of best fit and its equation for a report.
  • Checking a model: spot curvature or outliers in the residual table that would make a straight-line fit misleading.

Assumptions and limitations

  • Correlation is not causation. A strong pattern can come from a third variable that drives both x and y, or from coincidence in a small sample.
  • r and the trend line describe only straight-line relationships. A perfect U-shaped curve can have r close to 0.
  • Predictions from the trend line are only trustworthy inside the range of x values you observed; extrapolating beyond it assumes the pattern continues.
  • Per-group lines are fitted separately and are not a formal test that the slopes differ. With small groups, differences in slope can easily be due to chance.
  • This tool reports the fit, not inference. For p-values, confidence intervals on the slope and prediction intervals, use the Linear Regression Calculator or Pearson’s Correlation Test Calculator.

Frequently asked questions

What is a scatter plot used for?

A scatter plot is used to see whether two numeric variables are related. Each observation becomes one point, so the cloud of points shows the direction (positive or negative), the form (straight or curved) and the strength of the relationship, and it makes outliers easy to spot.

How do I make a scatter plot with a line of best fit?

Enter your x and y values in the table above and keep “Show trend line (least squares)” ticked. The scatter plot maker draws the points and the line of best fit together, and shows the equation ŷ = b₀ + b₁x, r and R². Download the chart as PNG or SVG when you are done.

How is the line of best fit on a scatter plot calculated?

The line of best fit is the least-squares regression line. Its slope is b₁ = Sxy / Sxx and its intercept is b₀ = ȳ − b₁x̄, which together minimize the sum of the squared vertical distances from the points to the line. It always passes through the point of means (x̄, ȳ).

Can I make a scatter plot with groups or multiple lines?

Yes. Type a group name for each row in the optional Group column and the points are coloured by group with a legend. Tick “Add a separate trend line for each group” to draw one dashed line per group, and compare each group’s r and slope in the results table.

What is the difference between r and R²?

r is the correlation coefficient: it runs from −1 to 1 and its sign gives the direction of the linear relationship. R² is r squared for a straight-line fit and gives the proportion of the variation in y explained by the line. An r of 0.9 means R² = 0.81, or 81% of the variation explained.

Which variable goes on the x-axis?

Put the explanatory variable, the one you think influences the other or that you control, on the x-axis and the response variable on the y-axis. If neither variable is clearly explanatory, the choice does not change r, but it does change the least-squares line.

What does a correlation close to zero mean on a scatter plot?

A correlation near zero means there is little or no straight-line relationship. The points may form a shapeless cloud, or they may follow a clear curve that a straight line cannot capture, which is why you should always look at the scatter plot rather than rely on r alone.

Cite this page

Statculator. (2026, November 14). Scatter Plot Maker. Retrieved November 14, 2026, from https://statculator.com/charts/scatter-plot-maker/