Scatter Plot Maker (with Line of Best Fit)
Free scatter plot maker: paste your x and y data, get the plot with a line of best fit, the regression equation, R², and r. Download as PNG, SVG, PDF, or CSV.
| Series | N | Slope | Intercept | Equation | r | R² |
|---|---|---|---|---|---|---|
| Score | 8 | 4.9881 | 47.6786 | y = 4.9881x + 47.6786 | 0.9972 | 0.9944 |
What a scatter plot is
A scatter plot shows the relationship between two variables by plotting one on the horizontal (x) axis and the other on the vertical (y) axis, with a point for each pair of values. The pattern of the points shows whether the two variables move together: up-to-the-right is a positive relationship, down-to-the-right is negative, and a shapeless cloud means little or no linear relationship. Add a line of best fit and you can summarize that relationship with a single straight line and read its equation.
What the line of best fit tells you
The line of best fit is the straight line y = mx + b that comes closest to all the points — the least-squares line, which minimizes the total squared vertical distance from the points to the line. Its slope m is how much y changes for each one-unit increase in x; its intercept b is the predicted y when x is zero. Two numbers describe how well the line fits: the correlation r runs from −1 to 1 (−1 and 1 are perfect straight-line fits, 0 is none), and R² (r squared, from 0 to 1) is the share of the variation in y that the line accounts for — an R² of 0.9 means the line explains 90% of the spread in y.
Worked example
Take the five points (1, 1), (2, 3), (3, 2), (4, 5), (5, 4). The least-squares line works out to y = 0.8x + 0.6: the slope is 0.8, so y rises by about 0.8 for each step in x, and the line crosses the y-axis at 0.6. The correlation is r = 0.8 and R² = 0.64, so a straight line explains about 64% of the variation in these points — a moderate, positive relationship rather than a perfect one.
Correlation is not causation
A strong line of best fit shows that two variables move together — it does not prove that one causes the other. Two things can correlate because both are driven by a third factor, or by pure coincidence in a small sample. Use the line to describe and predict within the range of your data, and be cautious about extending it far beyond the values you measured or reading cause into it.
How to make one
- Paste your data into the box: the first column is x, the second is y (one point per row, straight from Excel or Google Sheets).
- The scatter plot and the line of best fit appear instantly, with the equation, R², and r below.
- Add more columns to compare extra y-series against the same x, and adjust the title, axis labels, and point labels as needed.
- Download the plot as PNG, SVG, or PDF, or export the regression numbers as CSV.
FAQ
- How do I find the line of best fit for my data?
- Paste your x and y values (two columns) and the maker computes the least-squares line for you and draws it on the plot, along with its equation y = mx + b. You can paste straight from Excel or Google Sheets — tabs, commas, and new lines are all understood.
- What do R² and r mean?
- r is the correlation coefficient, from −1 to 1: values near 1 or −1 mean the points fall close to a straight line (positive or negative), and values near 0 mean little linear relationship. R² is r squared, from 0 to 1, and is the fraction of the variation in y that the line explains — R² = 0.75 means the line accounts for 75% of the spread.
- What is a good R² value?
- It depends on the field. In tightly controlled measurements an R² below 0.9 may be weak, while in messy real-world or social-science data an R² of 0.5 can be meaningful. Read R² together with how many points you have and what you know about the variables, not as a pass/fail threshold.
- Can I plot two data sets at once?
- Yes. Keep x in the first column and add a column for each extra y-series; the maker plots each series in its own color with its own line of best fit and a legend, all sharing the x-axis.
- Does a line of best fit prove one thing causes another?
- No. A line of best fit shows that two variables move together, not that one causes the other — the correlation could come from a third factor or coincidence. Use it to describe and predict, and be careful about reading causation into it or extending it beyond your data.