Skip to content

Scatter Plot Maker

Paste x, y pairs and get a scatter plot with an optional least-squares trend line, its equation and r². Color and shape points by group, set axis ranges that need not start at zero, and download the plot as SVG or PNG. Free, no sign-up.

Add a third value to put the point in a group, which gets its own color and marker. Separate with commas, tabs or semicolons — use semicolons if your numbers have decimal commas. A first line without numbers is read as a header.

10 points

Exam Score by Hours StudiedScatter plot of 10 points. x runs from 1 to 8 and y from 52 to 85. Least-squares line: y = 4.893x + 47.76, r² = 0.977.Exam Score by Hours StudiedHours studiedExam score505560657075808512345678y = 4.893x + 47.76, r² = 0.977
Show the data as a table
Hours studiedExam score
152
258
2.561
360
468
4.572
570
679
783
885

Least-squares line

GroupnSlope (b)Intercept (a)rr²
All points104.89347.760.9880.977

The line is ŷ = a + bx, fitted by ordinary least squares. r² is the share of the variance in y the line accounts for; it says nothing about cause.

Labels and style

Point color (the first group)
Axis ranges — leave blank for automatic

Takes the title out of the image and the gridlines out of the plot, and sets the figure number in bold and the title in italics above the chart — the APA 7 layout.

How to Use the Scatter Plot Maker

  1. 1. Enter the pairs. One point per line: the x value, then the y value — 3.5, 70. A first line such as Hours studied, Exam score is read as a header. Two columns pasted from a spreadsheet plot directly.
  2. 2. Group the points if you want. Add a third value to a line — 3.5, 70, Section B — and each group gets its own color and marker shape, with a legend.
  3. 3. Add a trend line. Choose one least-squares line through all the points, or one line per group. The equation and r² appear on the plot, and a table below gives the slope, intercept, Pearson's r and r² for each line.
  4. 4. Set the axes and export. Leave the axis ranges blank for automatic axes, or pin either end — an axis that starts at 40 is fine on a scatter plot. Add titles, switch on APA style for a paper, and download the SVG or PNG.

The Line of Best Fit

The trend line is the ordinary least-squares regression line, ŷ = a + bx — the line that makes the sum of the squared vertical distances from the points to the line as small as possible. Its slope b and intercept a are:

Least-squares line

b = Σ(x − x̄)(y − ȳ) ÷ Σ(x − x̄)2

a = ȳ − b·x̄

r2 = [Σ(x − x̄)(y − ȳ)]2 ÷ [Σ(x − x̄)2 · Σ(y − ȳ)2]

Here x̄ and ȳ are the means of x and y. r² is the square of Pearson's correlation coefficient r: the proportion of the variation in y that the straight line accounts for. For the example — ten students' study hours and exam scores — the tool gives y = 4.893x + 47.76 with r² = 0.977. Each extra hour of study goes with about 4.9 more points, and the line accounts for 97.7% of the variation in the scores.

Reading a Scatter Plot

  • Direction. Points that rise from left to right suggest a positive association; points that fall suggest a negative one.
  • Form. Check that the cloud is roughly straight before trusting the line. A curved pattern means a straight line — and its r² — misdescribes the relationship.
  • Strength. The more tightly the points hug the line, the closer r is to 1 or −1 and r² to 1.
  • Outliers. One point far from the rest can pull the line toward it. Try the plot with and without that point and report both if the line changes.
  • Cause. A strong r² says a line fits well. It says nothing about why the two variables move together — a third variable, or chance in a small sample, can produce the same picture.

Axes That Do Not Start at Zero

A scatter plot shows values by position, not by length, so its axes can start where the data start. Forcing zero onto an axis of exam scores between 50 and 90 would squash every point into the upper half of the plot and leave the lower half empty. The automatic ranges widen the data's range to round numbers on both axes. Pin either end when you want several plots on the same axes so readers can compare them; points outside the range you set are hidden, and the tool says how many.

Scatter Plots as APA Figures

  • Switch on APA style figure to take the title out of the image and drop the gridlines; paste the figure number (bold) and title (italic title case) above the image in your paper.
  • Describe the line in the note: Note. The dashed line is the least-squares regression line, ŷ = 47.76 + 4.89x, r2 = .98.
  • APA style drops the zero before the decimal point for statistics that cannot exceed 1, so write r2 = .98 and r = .99 in the text and note.
  • With groups, the different marker shapes keep the figure readable in grayscale, as APA recommends for color figures.

Frequently Asked Questions

How do I add a line of best fit to a scatter plot?
Set Trend line to One line through all the points. The tool fits the least-squares line ŷ = a + bx, draws it dashed across the plot, and prints its equation and r² in the corner; the table under the chart gives the slope, intercept, r and r². With groups, choose One line per group to fit each group separately.
What does r² mean on a scatter plot?
r², the coefficient of determination, is the share of the variation in y that the fitted straight line accounts for, from 0 to 1. An r² of 0.977 means the line accounts for 97.7% of the variation; 0.2 means most of the variation lies elsewhere. It measures fit, not cause, and it only describes straight-line relationships.
What is the difference between r and r²?
Pearson's r runs from −1 to 1 and gives both the direction and the strength of a straight-line relationship. r² is its square, so it loses the sign and runs from 0 to 1; it reads as a proportion of variance. An r of −0.8 and an r of 0.8 both give r² = 0.64. For r with a p-value, use the Correlation Calculator.
Do the axes of a scatter plot have to start at zero?
No. A scatter plot encodes values by position, so an axis can start near the data, and usually should — otherwise the points crowd into a corner. Start an axis at zero only when zero is meaningful for the comparison, and pin the same ranges when you place several plots side by side.
How do I make a scatter plot with different colors for groups?
Add the group name as a third value on each line: 2, 61, Morning. Each group gets its own color and marker shape and a legend entry. Up to eight groups get distinct colors; beyond that, the rest share one color as “Other groups” instead of repeating a color.
When should I use a scatter plot instead of a line graph?
Use a scatter plot when each point is a separate case measured on two variables — students, plots of land, countries — and you want to see whether the two move together. Use a line graph when one series is followed through an ordered variable such as time and consecutive points belong together.

Related Tools

More in Charts & Diagrams

See all Charts & Diagrams