Scientific FigureScientific Figure
Scatter Plot Generator

Scatter Plot Maker & Generator

A scatter plot maker for papers, theses and lab reports: give it x and y pairs and it draws the points with the line of best fit, r, R² and p calculated rather than guessed. Grouped data, 1:1 lines, log-log axes and residual plots included.

Journal styles in the scatter plot maker

Five journal presets, each on a different study the scatter plot maker drew: MYC and CCND1 expression with Spearman ρ, a BCA protein assay calibration curve, ROS in three neuron genotypes, HbA1c against fasting glucose with a 95% band, and exam scores with their residuals.

Nature

The scatter plot maker adds Spearman ρ beside Pearson r here, because two tumours at the top right pull r up.

Science

A BCA standard curve with the equation the scatter plot maker printed, ready to turn an unknown's absorbance into mg/mL.

Cell Press

Three genotypes on one scatter plot; the scatter plot maker gives each its own marker, line and r.

Clinical grayscale

Grayscale clinical version, where the scatter plot maker shades the 95% confidence band, narrowest at the mean of x.

Dark slide

A residual panel under the scatter on the same hours-studied axis, drawn by the scatter plot maker for a lecture slide.

Scatter plot examples

Four scatter plot examples from the scatter plot maker, each a real render of the prompt and pairs on its card: leaf nitrogen against photosynthetic capacity in 14 tree species with its line of best fit and p, bill length against bill depth in Adelie and Gentoo penguins with a line per species, a glucose meter checked against the lab analyser on a 1:1 line, and the mammal metabolic rate power law on log-log axes. Click a card to load its prompt and data into the box above.

Line of best fit, r and p

The scatter plot maker's default: the points, the least-squares line edge to edge, and r, R², p and n in the emptiest corner.

Two species, a line each

Two species, two lines: the scatter plot maker fits each group on its own, because pooled into one line these bills would seem to get shallower as they get longer.

Method comparison, 1:1 line

The dashed 1:1 line the scatter plot maker adds shows the meter reading about 1 mmol/L high, which r = 0.98 alone would hide.

Log-log, labelled species

On log-log axes the scatter plot maker fits log₁₀ values, so the mammal power law comes out straight with a slope of 0.73.

What is a scatter plot?

A scatter plot (scatter graph) shows how two numeric variables vary together: every observation is one marker, placed at its x value across and its y value up. The usual convention puts the response on the y axis and the variable suspected of driving it on the x axis. The cloud of points shows the direction of the relationship, how tight it is, whether it is straight or curved, and which observations sit apart from the rest. A straight line fitted by least squares, the line of best fit, summarises a linear trend, and Pearson's r with R² puts a number on how closely the points follow it. A scatter plot shows association only: it cannot show which variable causes the other.

About this scatter plot creator

  • Type pairs in brackets, Control: (1, 2.1), (2, 3.9)…, or give two lists of equal length. The scatter plot maker reads spreadsheets too: up to three .csv, .tsv or .xlsx files, x in one column and each series' y in the next.
  • The scatter plot maker computes the fitted line, Pearson r, R², the two-sided p and Spearman ρ in code from your pairs and hands them to the image model with every point's coordinates; the model only places them.
  • The scatter plot maker takes up to four groups, each with its own marker shape, its own line and its own r. Write "one line for all groups" for a single pooled fit.
  • Above 300 pairs the scatter plot maker draws a random 300 of them and says so; the statistics and the line still come from every pair.
  • Options are written in plain words: a 1:1 line, log-log axes, a residual plot, a 95% confidence band, the regression equation, axes from zero, point labels. The scatter plot maker reads them from the same box as the data.

How to use the scatter plot maker

1

Give the scatter plot maker your pairs

Type them as (x, y) in brackets, one group per line, or as two labelled lists of equal length, Height (cm): 160, 172, 181. Mass (kg): 55, 68, 80. Or attach the spreadsheet and the scatter plot maker reads x from the first numeric column and y from the next.

2

Tell the scatter plot maker what goes on the plot

Name both axes with units, then add what you need: the p value, the equation, Spearman ρ, a 1:1 line, log-log axes, a confidence band or a residual panel. With no instructions the scatter plot maker gives you the points, the line of best fit and r, R² and n.

3

Pick the journal style and render

Choose Nature, Science, Cell Press, clinical grayscale or a dark slide, then generate. Open or filled markers and line colour follow the venue; the coordinates, the line's ends and the printed statistics stay those the scatter plot maker computed.

The line of best fit, r and R²: the formulas

Least squares picks the slope b and intercept a that make the sum of squared vertical distances from the points to the line as small as possible; r is the same cross-product scaled by both spreads. With Sxx = Σ(x − x̄)², Syy = Σ(y − ȳ)² and Sxy = Σ(x − x̄)(y − ȳ), the formulas below are the ones the scatter plot maker computes, and the test of r on the right is the one that gives the p value.

b = Sxy ÷ Sxx a = ȳ − b·x̄ r = Sxy ÷ √(Sxx·Syy) R² = r² t = r·√((n − 2) ÷ (1 − r²)), df = n − 2

In words

The slope is how much y changes, on average, per unit of x. The line always passes through the point of means (x̄, ȳ). r runs from −1 (every point on a falling line) through 0 (no straight-line trend) to +1 (every point on a rising line), and squaring it gives R², the fraction of the variation in y that the line explains. The t statistic asks whether an r this far from zero could come from data with no correlation at all; its p shrinks as n grows, so a weak r can be significant in a large sample.

The line regresses y on x. Regressing x on y gives a different line unless r is ±1, so put the variable you want to predict on the y axis. On log axes the scatter plot maker applies every formula to log₁₀ values.

The scatter plot maker as a line of best fit calculator

Six illustrative readings of a snowy tree cricket's chirp rate at six air temperatures, worked through by hand with the formulas above. These are the sums the scatter plot maker does before it draws anything, so you can check a homework answer or a lab-report line against them, then let it draw the plot.

x (°C)y (chirps/min)x − x̄y − ȳ(x − x̄)(y − ȳ)(x − x̄)²
1683−7.5−5037556.25
1998−4.5−35157.520.25
22127−1.5−692.25
251361.534.52.25
281644.531139.520.25
311907.557427.556.25
Σ = 141Σ = 79800Sxy = 1113Sxx = 157.5
  1. 1

    Find the means

    x̄ = 141 ÷ 6 = 23.5 °C and ȳ = 798 ÷ 6 = 133 chirps per minute. Every least-squares line passes through this point of means, which is also where to pin a line of best fit drawn by eye before balancing the points above and below it.

  2. 2

    Add up the cross-products

    Multiply each pair's two deviations and add them: Sxy = 1113. Square the x deviations and add: Sxx = 157.5. The squared y deviations add to Syy = 7980, which r needs. The scatter plot maker runs these same sums in code.

  3. 3

    Slope and intercept

    b = 1113 ÷ 157.5 = 7.067 chirps per minute per °C, and a = 133 − 7.067 × 23.5 = −33.07. The line of best fit is y = 7.067x − 33.07, the equation the scatter plot maker prints when you ask for it, close to Dolbear's 1897 rule of thumb for this cricket, N = 7T − 30.

  4. 4

    r, R² and p

    r = 1113 ÷ √(157.5 × 7980) = 0.993, so R² = 0.986. With n − 2 = 4 degrees of freedom, t = 16.6 and the two-sided p is below 0.001, which the scatter plot maker prints as p < 0.001.

Scatter plot of cricket chirps per minute against temperature from 16 to 31 °C, six points close to the line of best fit y = 7.067x − 33.07, with the point of means at 23.5 °C and 133 chirps marked by a cross1520253075100125150175200Temperature (°C)Chirps per minute(x̄, ȳ) = (23.5, 133)y = 7.067x − 33.07r = 0.993, R² = 0.986, n = 6
The six readings as the scatter plot maker lays them out: the least-squares line through the point of means, with r and R² from the sums in the table.

Lines of best fit drawn by hand usually get the slope about right and the intercept wrong; the sums settle it. Send these six pairs to the scatter plot maker and compare its corner with the numbers above, or swap in your own readings.

What the scatter plot maker can draw

Seven kinds of scatter plot that turn up in papers, theses and lab reports, what each adds to the cloud of points, and the words that ask the scatter plot maker for it.

Scatter plot with line of best fit

The line of best fit is the least-squares regression line of y on x: of all straight lines, the one with the smallest sum of squared vertical distances to the points. It is the scatter plot maker's default, drawn edge to edge across the plot from its two computed end points, with r, R² and n printed in the emptiest corner. Spreadsheet programs call it a trendline. Add "show the equation" for y = bx + a, or "with a 95% confidence band" for the shaded band that is narrowest at the mean of x.

Scatter plot correlation: r, R² and p

r says how closely the points follow a straight line and in which direction; R² is the share of the variance in y the line accounts for. Ask the scatter plot maker for "the p value" and the corner adds the two-sided p of the t test of r = 0, on n − 2 degrees of freedom. Ask for Spearman for a rank correlation when the relationship rises steadily but is not straight, or one extreme point dominates. Write "no regression line" to keep the statistics without the line.

Grouped scatter plot (two or more sets of data)

Two to four groups share the axes, each with its own marker shape (circle, triangle, square, diamond) and colour, its own fitted line and its own r in the legend. Name each group before its pairs and the scatter plot maker keeps them apart: Adelie: (35.3, 16.2)… Gentoo: (43, 14.1)…. Look at the groups separately before pooling them: two clusters can each slope down while one line through both slopes up.

Method comparison scatter plot with a 1:1 line

Two measurement methods plotted against each other, both axes on one shared range so the dashed identity line y = x is the diagonal of a square plot area. Ask the scatter plot maker for "a 1:1 line" to get it. Points on that line agree exactly; the regression line beside it shows a constant offset (intercept) or a proportional bias (slope away from 1). A high r only says the methods rank samples alike, not that they agree, which is why clinical chemistry pairs this plot with a Bland–Altman plot of the differences.

Log-log scatter plot

Both axes in powers of ten, so a power law y = a·xᵇ becomes a straight line whose slope is the exponent b. The scatter plot maker computes the fit on log₁₀ x and log₁₀ y, which is how allometric relationships are estimated: mammal metabolic rate against body mass comes out near the classic three-quarter slope. Every value must be above zero; if one is not, the axes stay linear and the figure says so. Semi-log works too: "y axis on a log scale".

Residual plot

Each point's residual, the observed y minus the y on the fitted line, against x or the fitted values, around a dashed line at zero. Ask the scatter plot maker for a "residual plot" for the residuals alone, or "with residuals below" for the scatter on top and the residual panel under it on the same x scale. The four patterns worth knowing, and what to do about each, are further down this page.

Calibration curve (standard curve)

Absorbance, signal or peak area against the known concentrations of the standards, fitted with a straight line whose equation turns an unknown's reading into a concentration. Ask the scatter plot maker for the equation and R² and the corner prints y = bx + a to four significant figures, R² to two decimals, or three when two would round it up to 1. Keep the blank as a point at concentration zero rather than forcing the line through the origin.

Positive, negative and no correlation on a scatter plot

Describing a scatter plot comes down to four things: direction (positive, negative or none), form (straight or curved), strength (how tightly the points follow the trend) and anything unusual, such as an outlier or a cluster. Each pattern below comes with the r it usually has and what to check before reporting it. The cut-offs are a rough guide, not a rule.

Rise or fall almost along one line: a strong positive or negative correlation

Typical r
Close to +1 or −1
Check before you report it
Whether the agreement is real or built in, such as a variable plotted against a sum that contains it; the scatter plot maker fits whatever pairs it is given

Form a clear tilted ellipse: a moderate correlation

Typical r
Around ±0.5 to ±0.8
Check before you report it
The p value with n, and the residual plot for curvature; ask the scatter plot maker for both

Drift weakly with a lot of scatter: a weak correlation

Typical r
Around ±0.1 to ±0.3
Check before you report it
Whether a large n is making a small effect significant; the scatter plot maker prints n beside r for this reason

Form a round or shapeless cloud: no correlation

Typical r
Near 0
Check before you report it
That the range of x is not too narrow to show a trend; write "no regression line" and the scatter plot maker shows the cloud alone

Follow a curve, an arch or a U shape: a non-linear relationship

Typical r
Can be near 0 despite a strong relationship
Check before you report it
A log axis, Spearman ρ, or a curved model instead of a straight line; the scatter plot maker offers the first two

Sit in a cloud with one point far away: an outlier

Typical r
Pulled toward ±1 or toward 0 by that one point
Check before you report it
r with and without the point, and Spearman ρ, which ranks the values; ask the scatter plot maker for Spearman

The same r can come from very different scatter plots. Anscombe's four datasets share their means, variances, r and fitted line, yet one is a straight trend, one a curve, one a line with an outlier and one a vertical stack with a single distant point. That is why the scatter plot maker always draws the points, not only the coefficient.

Describing a scatter plot in one sentence

Give the direction, the form and the strength, then anything unusual, and quote r with n. For the cricket readings above:

Chirp rate rose with temperature in a strong, positive, linear relationship with no outliers (r = 0.99, n = 6).

The scatter plot maker prints r and R² for every plot. When the cloud curves or one point sits apart, ask for Spearman ρ as well and compare the two: this example has a step count that does not fit the rest.

Scatter plot vs line graph

A scatter plot shows unordered pairs and the trend through them; a line graph joins points in the order of x, usually time or dose, to show a change. Choose by whether connecting neighbouring points means anything.

Scatter plotLine graph
Each point isOne subject, sample or observationA value (often a mean) at one x position
Points joined?Never; the order of the rows is meaninglessYes, in order of x
Many y values at one xNormal, they stack verticallyUsually summarised as a mean with error bars
The line showsA fitted trend through the whole cloudThe path from one x value to the next
Typical figureExpression of gene A against gene B in 40 tumoursTumour volume over 21 days in treated and control mice

Use the scatter plot maker when each point is its own subject or sample; for measurements over time in the same subjects, use the line graph maker. For the pairwise correlations among many variables at once, a correlation matrix in the heatmap generator fits more than a grid of scatter plots.

Residual plots in the scatter plot maker: four patterns to read

A residual plot takes the line of best fit away and shows only what it missed: each point's observed y minus the fitted y, around a dashed line at zero. It is the quickest check that a straight line was the right summary of a scatter plot. Ask the scatter plot maker for "residuals below" and the panel sits under the scatter on the same x scale, as in the dark-slide style example.

A shapeless band around zero

Points above and below zero in roughly equal numbers at every x, with no trend. The straight line is an adequate model, and r, R² and p mean what they say.

What to doNothing to change; report the fit the scatter plot maker printed. The cricket readings above give this pattern.

A curve or U shape

Residuals positive at both ends and negative in the middle, or the reverse, mean the relationship bends and the straight line cuts across it. Growth curves and saturating responses do this.

What to doFor growth, put y on a log scale. The scatter plot maker then fits log₁₀ y on x, which is an exponential fit, and the curve straightens.

A funnel that widens

The spread grows with x, so the line fits small values tightly and large ones loosely, and the p value overstates how sure the fit is. Body sizes, counts and concentrations spanning orders of magnitude do this.

What to doAsk the scatter plot maker for log-log axes. The spread evens out and a power law turns straight, like the mammal card in the scatter plot examples.

One point far from zero

A single large residual is an outlier in y. If it also sits at the far end of x it can tilt the whole line, which makes it an influential point.

What to doCheck the record first. If the value is real, run the scatter plot maker with and without it and report both.

Residuals against the fitted values instead of x? Tell the scatter plot maker "residuals against fitted values". With one x variable the pattern is the same; only the horizontal axis changes.

Scatter plot maker vs Excel, Google Sheets and Desmos

Most scatter plots start in a spreadsheet or a graphing calculator. This is where each tool puts the line of best fit and its statistics, and where the scatter plot maker differs.

Scatter plot makerExcelGoogle SheetsDesmos
Data in(x, y) pairs typed in brackets, or a .csv, .tsv or .xlsx attachedTwo columns; each extra series added through Select DataTwo columns; the chart editor picks the seriesA table of x₁ and y₁ values, typed or pasted
Line of best fitLeast squares, drawn by defaultAdd Trendline, then LinearCustomize, Series, TrendlineType y₁ ~ mx₁ + b
Statistics shownr, R² and n on the figure; p, Spearman ρ and the equation on requestEquation and R² as a trendline labelEquation and R² as a trendline labelr and R² beside the regression, not on the graph
p valueTwo-sided p from the t test of rNot on the chart; from LINEST or the Analysis ToolPakNot on the chartNot given
GroupsUp to four, each with its own marker, line and rOne trendline per series, added one at a timeOne trendline per seriesOne regression typed per group
Log axesFit on log values, so the line is straight on the plotLog scale plus a Power or Exponential trendlineLog scale plus a Power or Exponential trendlineType the model, e.g. y₁ ~ a·x₁^b
OutputA journal-styled figure you can keep editing in the workspaceAn Office chart, styled by handA Sheets chart, styled by handA PNG or SVG of the graph

Already have the sheet? Attach the .xlsx to the scatter plot maker as it is: x in the first numeric column, each series' y in the next, a group or label column if you have one. That also avoids the most common Excel scatter plot complaint, a second series plotted against row numbers instead of its own x values.

Scatter plot maker questions, answered

How do you make a scatter plot?

Put the response variable on the y axis and the explanatory one on the x axis, then place one marker per observation at its pair of values. Choose axis ranges a little wider than the data, label both axes with units, and add a fitted line only if a straight-line trend is what you want to report. In the scatter plot maker you type the pairs or attach the spreadsheet, and the axes, line and statistics are computed before the figure is drawn.

Which variable goes on the x axis of a scatter plot?

The explanatory (independent) variable goes on x, the response on y. Dose, time, concentration or body size usually go across; what you measured in response goes up. When neither causes the other, as with two genes' expression, put the one you would predict from on x, since the least-squares line the scatter plot maker fits predicts y from x.

What is the difference between r and R² on a scatter plot?

r is the correlation coefficient, from −1 to +1, and carries the direction; R² is r squared, from 0 to 1, and is the proportion of the variance in y explained by the line. r = −0.7 and r = +0.7 both give R² = 0.49. Report r for a correlation and R² for how well a regression line fits; journals in many fields expect r with its p and n. The scatter plot maker prints r and R² together by default.

Is a trendline the same as a line of best fit?

For a straight line, yes: both are the ordinary least-squares regression of y on x. Spreadsheet software calls it a linear trendline; statistics texts call it the least-squares or regression line. The scatter plot maker always fits that line, on log values when an axis is logarithmic, and states its equation when you ask for it.

What does the p value next to r mean?

It is the probability of a correlation at least this far from zero if the true correlation were zero, from a t test with n − 2 degrees of freedom. A small p says the trend is unlikely to be chance; it says nothing about how strong the trend is. With 500 points, r = 0.1 gives p ≈ 0.025, so report r and n beside p. Ask the scatter plot maker for "the p value" and it prints all three.

When should I use Spearman's ρ instead of Pearson's r?

Use Spearman when the relationship rises or falls steadily but not in a straight line, when the data are ranks or scores, or when an outlier dominates r. Spearman's ρ is Pearson's r computed on the ranks of x and of y, so it measures any monotonic trend and one extreme value counts only as the top rank. Write "Spearman" and the scatter plot maker prints both coefficients.

Should I remove an outlier from a scatter plot?

Only if it is an error: a mistyped value, a failed sample or a unit slip. A real but unusual point stays in the data. Check whether it is influential by fitting the line with and without it; if r or the slope changes a lot, report both, or add Spearman ρ, which counts the extreme value only as the top rank. In the scatter plot maker, run the same prompt twice, once without the point, and compare the two corners.

Can the scatter plot maker fit a curve instead of a straight line?

It fits straight lines only, but on log axes a straight line is a curve in the original units. Put y on a log scale and the fit is exponential, y = a·10^(bx); log both axes and it is a power law, y = a·xᵇ. The scatter plot maker does not offer quadratic or other polynomial fits, so for a peak or a plateau ask for the points with "no regression line" and report the model from your statistics software.

Can the scatter plot maker label individual points?

Yes: add a name as the third value, (0.025, 0.24, Mouse), and the scatter plot maker prints it beside the marker. Up to 20 points are labelled; more would cover the cloud. Write "no labels" to keep the names in the data but off the figure.

Can the scatter plot maker make a bubble chart or show a third variable?

Not as bubble size: every marker the scatter plot maker draws is the same size. A third variable can come in as groups instead. Split it into two to four bands, such as low, medium and high dose, name each band before its pairs, and each gets its own marker shape, colour, line and r.

Should the axes of a scatter plot start at zero?

No: unlike a bar chart, a scatter plot's axes should span the data, not the origin. Forcing zero squeezes the cloud into a corner and hides the trend. Include zero only when it means something for the figure, such as a calibration curve's blank or an intercept you want readers to see; the scatter plot maker spans the data by default, and "axes from zero" gets you the origin.

What is the difference between a scatter plot, an XY graph and a dot plot?

An XY graph is any chart drawn on two numeric axes; a scatter plot is the XY graph of unconnected points, which is what the scatter plot maker draws. A dot plot is different again: one numeric axis, with each observation a dot stacked along it per category or value, so it shows a distribution rather than a relationship between two variables.

Does the scatter plot maker change my numbers?

No: the scatter plot maker calculates every point's coordinates, the axis ticks, the fitted line's two end points and the printed r, R², p and n in code and states them to the image model, which only places them. It is told never to move, add or drop a point or refit the line. Above 300 pairs the drawn cloud is a random 300, while every statistic still uses all of them.

Is the scatter plot maker free?

You can use the scatter plot maker on the free plan, with a watermark on exports. Paid plans remove the watermark and unlock every model and high-resolution export, and the figures can go into papers, theses, courses and commercial material.

Sources

Put your pairs into the scatter plot maker

Type or attach your x and y values and the scatter plot maker returns a journal-ready figure with the line of best fit, r, R² and p computed for you.

Open the scatter plot maker