Format Code Now
/

Scatter Plot Maker

FV-53

Paste X values in the first column and Y values in the next, and each row becomes a point. Add a trend line to see the straight line fit and its R squared.

Runs in your browser. Nothing is uploaded.

Data (CSV or tab)

Scatter plot

Study time and test score: scatter plot of Class A, Class B against Hours, 10 rows.

How to use it

  1. Paste the data with a header row: X values first, then one column of Y values per series.
  2. Type a title and the X and Y axis titles.
  3. Tick Trend line to draw the least squares fit; its equation appears in the status line.
  4. Download the scatter plot as PNG or SVG.

Data layout for one or more series

Every row is one X value. The first column is X and every further column is a series of Y values that share it, so a table of hours studied with scores for two classes gives two colored series on one plot. Both axes are numeric and use round steps, so 1, 2 and 10 sit at their real distances. Each series also gets its own marker shape, which keeps the plot readable in grayscale.

The trend line and R squared

The trend line is an ordinary least squares fit, y = a + bx. The slope b is the sum of (x minus mean x) times (y minus mean y) divided by the sum of (x minus mean x) squared, and a = mean y minus b times mean x. R squared is the share of the variation in Y the line explains, from 0 to 1. For x = 1 to 5 and y = 2, 4, 5, 4, 5 that gives y = 0.6x + 2.2 with R squared 0.600.

What a scatter plot does not tell you

A tight cloud around the trend line shows that two measures move together. It does not show that one causes the other, and a straight line can miss a curved pattern, so look at the points as well as R squared. The fit is drawn only across the range of your X values, because extending it beyond the data is a guess.

Error messages and what to do

MessageWhat it meansFix
Row 7, column "Hours": "7.5h" is not a number.The X column must hold numbers too.Remove the unit from the cell and keep it in the header.
Row 3, column "Class B" is empty. Fill in a number or remove the row.Every series needs a Y value on every row.Fill in the value, or put series with different X values on separate plots.

Questions people ask

How do I make a scatter plot from two columns?

Paste the two columns with a header row, X first and Y second, for example height and weight. Each row becomes one point. Add more Y columns to plot several series against the same X values.

How is the trend line calculated?

It is a least squares linear regression: the straight line that makes the sum of squared vertical distances from the points as small as possible. The status line gives the equation, y = bx + a, and R squared for each series.

What does R squared mean on a scatter plot?

It is the share of the spread in Y that the straight trend line accounts for, from 0 to 1. Near 1, the points sit close to the line; near 0, the line explains little. It measures a straight line fit only.

Can a scatter plot have negative values?

Yes, on both axes. The axes extend to cover the smallest and largest values with round tick steps. Tick Axes from zero to make both axes include zero even when all your values are far from it.

Why are my points spaced evenly in a line graph but not here?

A line graph treats the first column as labels and spaces them evenly. A scatter plot reads the first column as numbers and places each point at its real value, so gaps in X show as gaps on the plot.

About this tool

Paste CSV or tab-separated data (for example straight from a spreadsheet) with a header row first. The first column holds the X values and every further column is one series of Y values sharing those X values, each with its own color and marker shape. Both axes are numeric with round steps. The trend line is an ordinary least squares fit, y = a + bx, drawn over the range of your X values, and its equation and R squared appear in the status line. It is a straight line only: no curves, and it says nothing about cause. Empty or non-number cells stop the plot with the row and column named. Up to 5,000 rows and 12 series.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.