Scatter Plot Maker & Generator
Creates scatter plots from x and y pairs for papers, theses and lab reports, with the line of best fit, r, R² and p calculated rather than guessed. Draws grouped data, 1:1 lines, log-log axes and residual plots.
Scatter plot styles
Five journal presets, each on a different study: 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.
Scatter plot examples
Four scatter plot examples, 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.
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. Spreadsheets work too: up to three .csv, .tsv or .xlsx files, x in one column and each series' y in the next.
- The fitted line, Pearson r, R², the two-sided p and Spearman ρ are computed in code from your pairs and handed to the image model with every point's coordinates; the model only places them.
- 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 figure 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.
Scatter plots you can make here
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 this tool 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 default here, 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 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 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: 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. 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 fit is computed 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. A shapeless band means the straight line is adequate; a curve means the relationship is not linear; a funnel means the spread grows with x. Write "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.
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 for the equation and R²: 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.
How to make a scatter plot
Give the 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: x in the first numeric column, y in the next.
Say 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 you get the points, the line of best fit and r, R² and n.
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 code 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 this tool 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 every formula is applied to log₁₀ values.
Reading a correlation from a scatter plot
What the cloud of points looks like, the r it usually comes with, and what to check before reporting it. The cut-offs are a rough guide, not a rule.
| What the points do | Typical r | Check before you report it |
|---|---|---|
| Lie almost on one rising or falling line | Close to +1 or −1 | Whether the agreement is real or built in, such as a variable plotted against a sum that contains it |
| Form a clear tilted ellipse | Around ±0.5 to ±0.8 | The p value with n, and the residual plot for curvature |
| Drift weakly with a lot of scatter | Around ±0.1 to ±0.3 | Whether a large n is making a small effect significant |
| Form a round or shapeless cloud | Near 0 | That the range of x is not too narrow to show a trend |
| Follow a curve, an arch or a U shape | Can be near 0 despite a strong relationship | A log axis, Spearman ρ, or a curved model instead of a straight line |
| Sit in a cloud with one point far away | Pulled toward ±1 or toward 0 by that one point | r with and without the point, and Spearman ρ, which ranks the values |
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 plot is shown, not only the coefficient.
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 plot | Line graph | |
|---|---|---|
| Each point is | One subject, sample or observation | A value (often a mean) at one x position |
| Points joined? | Never; the order of the rows is meaningless | Yes, in order of x |
| Many y values at one x | Normal, they stack vertically | Usually summarised as a mean with error bars |
| The line shows | A fitted trend through the whole cloud | The path from one x value to the next |
| Typical figure | Expression of gene A against gene B in 40 tumours | Tumour volume over 21 days in treated and control mice |
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.
Scatter plot 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. Here 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 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.
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. This tool 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.
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 both coefficients are printed.
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; write "axes from zero" to get it.
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. 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.
How do I show the correlations among many variables?
Six or more variables give at least 15 pairs, too many for separate scatter plots in a paper, so the usual figure is a correlation matrix drawn as a heatmap. Make it in the heatmap generator and keep a scatter plot here for the one or two pairs the paper is about, where readers need to see the points.
How should a scatter plot's figure legend be written?
Say what each point is, what the line is and which statistic was tested, with n. For example: "Each point is one tree species (n = 14). Line, least-squares regression; Pearson r = 0.93, two-sided p < 0.001." Name the groups, state any log scale, and say if the drawn points are a subset of a larger sample.
Does the AI change my numbers?
No: every point's coordinates, the axis ticks, the fitted line's two end points and the printed r, R², p and n are calculated in code and stated 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.
Sources
- 1.3.3.26. Scatter Plot — NIST/SEMATECH e-Handbook of Statistical Methods
- 12.4 Testing the Significance of the Correlation Coefficient — OpenStax, Introductory Statistics 2e
Keep exploring
Our other diagram tools, and the guides behind them.
Tools
Make a scatter plot from your pairs
Type or attach your x and y values and get a journal-ready scatter plot with the line of best fit and its statistics computed for you.
Make a scatter plot