Scatter plot maker: trend line, equation and R²

Make a scatter plot online: several series of points, a linear trend line with its equation and R². Paste data from a table, Excel or a CSV file.

First column — X values, other columns — Y: each column becomes a set of points in its own color. Paste a table from Excel or Google Sheets with Ctrl+V into any cell.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Image 1200 × 750 pixels

Trend line

EquationR²r
Weight, kgy = 1.1706·x − 134.37510.96730.9835

Style

px
px

How to use

The first column of the table holds the X values, the other columns hold the Y values. Each Y column is a separate series of points in its own color, named after the column header. Paste a table from Excel or Google Sheets (Ctrl+V in any cell; pasting into the top-left cell replaces the whole table) or open a CSV file. Rows where X or Y isn’t a number are skipped, and a warning appears below the chart.

Unlike a line graph, here horizontal distances are proportional to the X values: points at 1, 2 and 10 won’t be evenly spaced.

Trend line

The trend line is the straight line y = a + b·x fitted by least squares, like a linear trendline in Excel. Below the chart is a table with the equation, the coefficient of determination R² and the correlation coefficient r for each series. Tick “Equation and R² on chart” to put the equation and R² into the legend on the image itself.

Turn the trend line on or off under “Style”. The same panel has the title, axis titles, Y axis from zero, colors, background and image size.

Example

Height and weight of 15 people: heights from 158 to 191 cm, weights from 52 to 90 kg. The trend line is y = 1.171·x − 134.4, R² = 0.967, r = 0.984. On average each centimeter of height adds 1.17 kg, and the line predicts about 64.6 kg for a height of 170 cm.

FAQ

Does a high R² mean X affects Y? No, only that the points fit a straight line well. The relationship may come from a third factor or be a coincidence in a small sample.

Can I extend the trend line beyond the data? The line is drawn only from the smallest to the largest X. Predicting beyond that range is at your own risk: the straight line may stop describing the data.

Do you have a nonlinear trend line? No, only a straight line.

Where is my data stored? Only in your browser and in the page address after the # sign, which isn’t sent to the server. You can save the link or send it to someone.