Scatter Plot Generator: Explore Correlation with Your Own XY Data

Reveal correlations and patterns between two numeric variables.

Display Options
Appearance
Box Plot AI

Hi! I'm your Box Plot analysis assistant.

• Analyze the data currently on your chart — I'll interpret min, Q1, median, Q3, max, IQR, and outliers • Generate sample data — e.g. "generate 10 datasets of monthly temperatures, 20 points each" • Explain statistics — ask me "what does IQR tell me?" or "how to spot skewness in a box plot"

Try: "Analyze my current data" or "Generate temperature data for 12 cities, 15 points each"

How to Use This Scatter Plot Generator: Explore Correlation with Your Own XY Data

  1. Enter X and Y values. Type or paste paired values — one line for X coordinates, one line for Y coordinates. Both lines must have the same number of values.
  2. Click Generate. The tool plots every (X, Y) pair and fits an ordinary least squares (OLS) regression line.
  3. Read the pattern first. Before trusting any number, look: is the trend linear or curved? Are there clusters or isolated points far from the cloud?
  4. Read the R² value. This shows how well the regression line fits (0 = no fit, 1 = perfect fit). A low R² with a visible curve means the relationship is non-linear, not absent.
  5. Export your results. Download the chart as PNG/SVG or the regression statistics as CSV/XLSX for your report.

What is a Scatter Plot?

A scatter plot displays individual data points on a two-dimensional plane, with X and Y coordinates representing two numeric variables. Each point represents one observation, making scatter plots the go-to chart for exploring relationships between paired variables.

Unlike charts that summarize a single variable, a scatter plot keeps every (X, Y) pair visible, so you can judge not just whether two variables move together, but how — linearly, along a curve, in clusters, or not at all. It is the standard first step before computing a correlation coefficient or fitting a regression model.

This tool adds two workhorses of regression analysis on top of the raw plot: the ordinary least squares (OLS) trend line and the R² value, so you can move from a visual impression to a quantified fit in one step.

Interpreting Patterns

  • Upward trend = positive correlation — as X increases, Y tends to increase.
  • Downward trend = negative correlation — as X increases, Y tends to decrease.
  • Random cloud = little to no linear correlation.
  • Curved pattern = non-linear relationship — a straight line (and Pearson's r) will understate it.
  • Isolated points far from the cloud = outliers or high-leverage points that can dominate the regression.
  • Separate clusters = possible subgroups — consider splitting the data and analyzing each group.

Worked Example: Study Hours vs. Exam Score

Load the Study Hours vs Score sample: X = hours studied (1–10), Y = exam score (45–82). The points rise from lower-left to upper-right with moderate scatter — a clear positive relationship.

The OLS line has a slope of roughly 4 points per hour: each additional hour of study is associated with about a 4-point score increase. The intercept (~48) is the predicted score for zero hours of study. R² ≈ 0.9 means about 90% of the variation in scores is explained by study hours — a strong fit for social-science data.

To sanity-check the slope by hand, pick two points on the line, say (2, 55) and (8, 79): slope = (79 − 55) / (8 − 2) = 24 / 6 = 4. Note what the plot cannot tell you: whether studying caused the scores. Motivated students may both study more and score higher for other reasons.

Common Misreadings

  • Correlation ≠ causation. Ice cream sales correlate with drowning deaths; a third variable (summer) drives both.
  • Trusting r without plotting. Anscombe's quartet shows identical statistics can hide curves, outliers, and single-point leverage.
  • Extrapolating the line. The regression line is only reliable within the observed X range.
  • Ignoring R² context. R² = 0.3 may be strong in psychology but weak in physics; judge against your field's norms.
  • Over-reading small samples. With a handful of points, one stray observation can flip the slope sign.

Frequently Asked Questions

What does a scatter plot show?
A scatter plot displays the relationship between two numeric variables, with each point representing one observation. Patterns reveal correlation, clusters, non-linear trends, and outliers that summary statistics alone would hide.
How is the regression line calculated?
The tool uses ordinary least squares (OLS) linear regression, which minimizes the sum of squared vertical distances between the points and the line. The R² value indicates how well the line fits the data (0 = no fit, 1 = perfect fit).
What is the difference between correlation and causation?
A scatter plot can only show association. Even a strong correlation (points tightly following a line) does not prove that X causes Y — a lurking third variable may drive both. Controlled experiments, not scatter plots, establish causation.
What does R² tell me?
R² (the coefficient of determination) is the proportion of variance in Y explained by the linear relationship with X. R² = 0.8 means 80% of the variation in Y is captured by the line. A low R² with a clear curve in the points suggests a non-linear relationship that a straight line cannot capture.
Why should I always plot before trusting a correlation coefficient?
Anscombe's quartet — four datasets with identical means, variances, and correlations but wildly different scatter patterns — shows why. A single summary statistic can hide curves, outliers, and clusters that are obvious the moment you plot the points.

Key Terms

Correlation
Measures the strength and direction of the linear relationship between X and Y.
Independent Var (X)
The variable that is manipulated or controlled.
Dependent Var (Y)
The variable that is measured or observed.
Regression Line
A best-fit line through the scatter points, showing the trend.

Computation Method

  • Quartiles are calculated using linear interpolation (method 7 from Hyndman & Fan, 1996), consistent with Python's NumPy and pandas defaults.
  • Outlier detection uses the Tukey fences method: lower fence = Q1 − 1.5 × IQR, upper fence = Q3 + 1.5 × IQR.
  • Chart scaling caps the display axis at the upper fence value so the visualization remains clear even when extreme outliers are present.

References