Curious Minds

Clear answers to science and history questions

How to Build a Scatter Plot: Step-by-Step Guide

· 7 min read · Science

A scatter plot is a graph that displays two quantitative variables as points on a horizontal and vertical axis, with each point representing one observation. It shows the relationship between the variables — whether they rise together, fall together, or show no pattern — and helps spot clusters, gaps, and outliers that summary statistics can hide. Building one requires only a small set of paired data and a plotting tool, whether a spreadsheet, a statistical package, or a short script. The steps below cover preparing the data, choosing the axes, plotting, and refining the chart so the pattern is easy to read.

What You'll Need

  • Two quantitative variables measured on the same observations — for example, height and weight for each person, or temperature and ice-cream sales for each day.
  • A data table with one row per observation and the two variables in separate columns.
  • A plotting tool: a spreadsheet program, a statistical package, a programming library, or an online chart maker.
  • Optional: a third variable for colour or size coding, and a way to label points if individual observations matter.

Step-by-Step

  1. Check that both variables are quantitative. Scatter plots are for numbers measured on an interval or ratio scale, such as age, mass, or concentration. Categorical variables like eye colour or country belong in bar charts, not on a scatter axis. If a variable is ordinal with many levels, treat it cautiously — the spacing between levels may not be equal.
  2. Clean and pair the data. Each row should contain one observation with both values present. Remove or flag rows where either value is missing, because a point cannot be placed without both coordinates. Check for obvious data-entry errors — a decimal point in the wrong place, a value recorded in different units, or a duplicate row — before plotting, since a single bad value can stretch an axis and squash the rest of the data.
  3. Decide which variable goes on which axis. By convention, the variable you think of as the explanatory or independent variable goes on the horizontal (x) axis and the response or dependent variable on the vertical (y) axis. If there is no natural direction, either assignment is acceptable, but state it clearly in the axis labels.
  4. Choose sensible axis scales. Start each axis at or near the lowest value in the data rather than automatically at zero, unless zero is meaningful and the range is small. Use a linear scale by default. Consider a logarithmic scale only when values span several orders of magnitude, and label the axis accordingly so readers know the scale has changed.
  5. Plot the points. In a spreadsheet, select the two columns and insert an XY (scatter) chart — not a line chart, which connects points in row order and will mislead. In a programming library, call the scatter function with the two variable arrays. Confirm that the number of points on the chart matches the number of complete rows in your data.
  6. Add axis labels and units. Label each axis with the variable name and its unit, for example "Daily temperature (°C)" and "Ice-cream sales (units)". Unlabelled axes make the chart impossible to interpret later, even for the person who made it.
  7. Add a descriptive title. State what the chart shows and, where relevant, the population and time period — for example, "Ice-cream sales versus daily temperature, city shop, summer months". Avoid vague titles like "Chart 1".
  8. Adjust point size and transparency. With many points, solid markers overlap and hide density. Use smaller markers and partial transparency so overlapping points appear darker, revealing where the data cluster. This is often more informative than a plain scatter and requires only a setting change.
  9. Look for pattern, strength, and outliers. Describe the form (linear or curved), the direction (positive or negative), and the strength (tight or scattered). Identify points that sit far from the main cloud and check whether they are recording errors or genuine extreme values. Do not delete outliers without justification; note them and consider analysing the data with and without them.
  10. Add a trend line only if it fits. A straight line of best fit is appropriate when the relationship looks roughly linear. A curved pattern calls for a curve or a transformation of the data instead. Report the fit cautiously — a line through scattered points does not prove that one variable causes the other.
  11. Refine and export. Remove unnecessary gridlines and background shading, ensure the font is legible at the intended size, and export at a resolution suitable for print or screen. Check the final image at its display size before sharing.

Common Mistakes

  • Using a line chart instead of a scatter plot. A line chart connects points in the order they appear in the table, creating a false trend. Always choose the XY scatter chart type.
  • Plotting categorical data on an axis. Categories have no numerical distance between them, so their positions on a scatter axis are arbitrary and the pattern is meaningless.
  • Forcing the axis to start at zero. When all values lie in a narrow band far from zero, starting at zero compresses the points into a thin strip and hides the relationship. Start near the data range unless zero is meaningful.
  • Overplotting. Hundreds of solid points on top of each other look like a single blob. Use transparency, smaller markers, or binning to show density.
  • Ignoring missing values. Rows with one missing coordinate are silently dropped by many tools, which can bias the picture if the missingness is not random. Check how many rows were excluded and why.
  • Interpreting correlation as causation. A tight scatter pattern shows association, not cause. A third variable may drive both, or the relationship may be coincidental.

Tips

  • Plot the raw data before computing any summary. A scatter plot often reveals subgroups or a curved relationship that a single correlation coefficient would miss.
  • Use colour or marker shape to encode a third categorical variable, such as group or region, but keep the palette small and distinguishable.
  • When points overlap heavily, try a hexbin or density plot as a companion; these summarise local density without hiding individual extremes.
  • Keep the aspect ratio roughly square unless one variable has a much wider range; extreme stretching can make a weak trend look strong or vice versa.
  • Record the exact settings — axis limits, transformations, excluded rows — so the chart can be reproduced or updated later.

Troubleshooting

  • All points form a vertical or horizontal line. One variable may be constant or nearly so, or the wrong column was selected. Check the data range and the column mapping.
  • Points are bunched in one corner with a few far away. A few extreme values are stretching the axes. Inspect those values for errors; if genuine, consider a logarithmic scale or plot the bulk of the data separately and note the extremes.
  • The chart shows a diagonal line of points. This usually means the same variable, or two variables that are mathematically linked, were plotted against each other. Verify the column selection.
  • Points are missing. Rows with blank or non-numeric entries are typically excluded. Count the plotted points against the complete rows to find the gap.
  • The pattern looks like a curve but a straight line was fitted. The relationship is non-linear. Try transforming one variable (for example, taking logarithms) or fitting a curve, and describe the shape rather than forcing a line.
  • The chart is unreadable when shrunk. Reduce the number of labels, enlarge markers and fonts, or split the data into panels by group.

Frequently Asked Questions

What is the difference between a scatter plot and a line chart?

A scatter plot places each observation as a point using two numerical values as coordinates. A line chart connects points in sequence, usually to show change over time. Using a line chart for unordered pairs creates a misleading path between points.

Can a scatter plot show more than two variables?

Yes. Two variables define the axes, and additional variables can be shown through colour, marker size, or shape. However, too many encodings make the chart hard to read, so limit extras to one or two.

How many points does a scatter plot need?

There is no fixed minimum, but with very few points the pattern is unreliable and easily dominated by a single value. More points generally give a clearer picture, though overplotting becomes an issue with large datasets and calls for transparency or density methods.

Should the axes always start at zero?

No. Starting at zero is important when the zero point is meaningful and the data range is small. When values lie far from zero, starting near the data range makes the relationship visible; state the axis limits so readers are not misled.

Does a pattern in a scatter plot prove causation?

No. A scatter plot shows association between two variables. Causation requires evidence beyond the chart, such as controlled experiments or careful adjustment for confounding variables.

What should I do with outliers?

First check whether they are data errors and correct them if so. If they are genuine, keep them, describe them, and consider showing the analysis with and without them so readers can judge their influence.

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions