Skip to content

Scatter plot maker

Enter or paste X and Y values and the XY graph updates as you type. Turn on the line of best fit to get its equation and R² right on the chart.

  • Free, no sign-up
  • Runs in your browser
  • PNG and SVG export

Data

Scatter plot data
XYPoint labelRow actions

Line of best fit

Chart

Style

Background

Preview

How to

How to make a scatter plot

A scatter plot shows whether two measurements move together. Each point is one thing you measured twice: a student's hours of study and test score, a day's temperature and ice cream sales, a car's weight and fuel use. The shape of the cloud tells you if there is a relationship, how strong it is, and which points do not fit.

  1. Enter the pairs. Type an X and a Y value on each row. The X axis holds the variable you think explains the other one; the Y axis holds the one that responds.
  2. Or paste from a spreadsheet. Copy two columns from Excel or Google Sheets and press Paste from a spreadsheet. A third column becomes the point labels, a fourth the groups. If the first column is text, such as names, it is used as the labels.
  3. Add the line of best fit. It is on by default. The equation and R² appear above the plot, and the slope, intercept and correlation are listed under Line of best fit.
  4. Compare groups. Tick My data has groups and name the group of each point. Every group gets its own color and its own line.
  5. Export. Download a PNG for a report or slides, or an SVG you can edit and print at any size.

How the line of best fit is calculated

The line is the least squares regression line of Y on X: the straight line that makes the sum of the squared vertical distances from the points to the line as small as possible. Its slope is the covariance of X and Y divided by the variance of X, and it always passes through the point (mean of X, mean of Y). The line is drawn only across the range of your X values, because stretching it past your data is a guess, not a result.

What R² tells you

R² is the share of the variation in Y that the line explains, from 0 to 1. An R² of 0.81 means 81% of the ups and downs in Y follow the straight line; the rest is scatter. For a straight line fit it equals the square of the correlation coefficient r, which is shown too, because r keeps the sign: positive when Y rises with X, negative when it falls.

Tip

A high R² does not mean X causes Y, and a low one does not mean there is no pattern. A curve, like the path of a thrown ball, can have an R² near 0 for a straight line. Always look at the plot, not just the number.

Scatter plot or line graph?

Use a scatter plot when each point is a separate case and the order of the rows does not matter. Use a line graph when the X axis is a sequence, such as months, and the line between points means something. To look at a single measurement on its own, a histogram or a box plot shows how it is spread out.

Questions people ask

How do I create a scatter graph?

Put your two measurements in two columns: the one you think drives the other goes on the X axis, the one that responds goes on the Y axis. Each row is one point. Type or paste the pairs into the table above, give both axes a title, and download the chart as PNG or SVG.

How do I create a scatter plot for two sets of data?

If you mean two measurements of the same things, such as height and weight of each student, those are the X and Y columns. If you mean two separate groups you want to compare on one chart, turn on 'My data has groups' and fill in the Group column. Each group gets its own color, legend entry and, if you want, its own line of best fit.

Can I make a scatterplot in Excel?

Yes. Select the two columns, then choose Insert, Charts, Scatter. For a line of best fit, open Chart Elements, tick Trendline, and in the trendline options check 'Display Equation on chart' and 'Display R-squared value on chart'. The slope, intercept and R² should match what this maker shows, because both use least squares.

Can you create a scatter plot in Google Sheets?

Yes. Select the data, choose Insert, Chart, and set the chart type to Scatter chart. The trendline is under Customize, Series, Trendline, where you can also show the equation and R².

Guides for this tool

Gallery

Made with graphsmith

Real SVG exports from the template sets. Open one and it lands in the tool with its data filled in, ready to edit.