Distribution plot: draw a distribution and shade its areas

Updated

A distribution plot draws the curve of a probability distribution, such as the normal, t, chi-square or F, and can shade the area under part of it. The shaded area is a probability: the share of parts below a limit, or the chance that a test statistic lands beyond a critical value. Unlike most graphs, it does not plot your data; it plots a model, which makes it the natural picture for explaining a probability, a critical value or a p-value.

When to use it

  • You want to show what share of a process falls outside a specification, given its mean and standard deviation.
  • You explain a critical value or a p-value: the shaded tail of a t, chi-square or F distribution.
  • You compare distributions, such as a t with few degrees of freedom against the normal, or a process before and after a shift of the mean.
  • You teach or check the shape of a distribution before using it in a calculation.

How it works

  1. Choose the distribution and its parameters: mean and standard deviation for the normal, degrees of freedom for t and chi-square, two degrees of freedom for F, n and p for the binomial, the mean for the Poisson.
  2. Draw its probability density function (PDF) over the range where it has most of its probability. For a discrete distribution, such as the binomial or Poisson, draw bars at each whole number instead of a curve.
  3. To shade an area, give either:
    • an x value, and get the probability beyond it from the cumulative distribution function (CDF): P(X ≤ x) = F(x) for the left tail, 1 − F(x) for the right tail;
    • a probability, and get the x value that cuts it off from the inverse CDF: x = F⁻¹(p).
  4. Shade one tail, both tails, or the middle, and label the probability and the cut-off.

The height of a density curve is not a probability; only areas are. The total area under the curve is 1. The calculations behind the plot are the same CDF and inverse CDF functions described in probability distributions.

Example

Fill weights. A filler puts coffee into jars labeled 500 g. The filling process is stable and close to normal, with mean 500.6 g and standard deviation 0.4 g. What share of jars is under the label weight?

Normal distribution of fill weight, mean 500.6 g, sd 0.4 g0.000.250.500.751.00Density499499.4499.8500.2500.6501501.4501.8502.2Fill weight (g)
Normal distribution of fill weight, mean 500.6 g, sd 0.4 g

A distribution plot shades the left tail below 500 g. Its area is

P(X < 500) = Φ((500 − 500.6) / 0.4) = Φ(−1.5) = 0.0668

so about 6.7% of jars, one in fifteen, are under 500 g. In StatLab's calculator this is NORMCDF(500, 500.6, 0.4).

Going the other way, the plant wants at most 1% of jars under 500 g. The inverse CDF gives the weight below which 1% of jars fall at the current setting: NORMINV(0.01, 500.6, 0.4) = 499.67 g. To move that 1% point up to 500 g with the same spread, the mean has to rise to 500 + 2.326 × 0.4 = 500.93 g, where 2.326 is NORMINV(0.99). The plot makes the trade-off visible: shifting the curve right by 0.33 g shrinks the shaded tail from 6.7% to 1%.

The t distribution against the normal. A second common use is comparing shapes. The t distribution with 4 degrees of freedom, used for a sample of 5, has the same center as the standard normal but heavier tails:

Standard normal and t distribution with 4 degrees of freedom0.00.10.20.30.4DensityNormalt, 4 df-4-3-2-101234Value
Standard normal and t distribution with 4 degrees of freedom

Shading both tails beyond ±2 gives 0.0455 under the normal but 0.116 under t with 4 degrees of freedom. The cut-offs for 2.5% in each tail are 1.960 for the normal and 2.776 for t with 4 df (TINV(0.975, 4)). That is why confidence intervals from small samples are wider: the t curve puts more probability far from the center.

How to read the results

  • Shaded area = probability. Read it from the label, not by eye; tails look thin even when they hold several percent.
  • Cut-off values are where the shading starts. A one-sided 5% cut-off sits closer to the center than a two-sided 5% cut-off, which puts 2.5% in each tail.
  • Compare curves by center, spread and tails. A curve that is lower in the middle and higher in the tails, like t against the normal, gives more extreme values.
  • Check the parameters in the title. A plot is only as good as the mean, standard deviation or degrees of freedom behind it.

Common mistakes

  • Reading the curve height as a probability. For a continuous distribution, the probability of any single exact value is zero; only areas count.
  • Assuming the model fits the process. A normal curve with the right mean and standard deviation still misstates the tails if the data are skewed. Check with a probability plot first.
  • Mixing up one- and two-tailed areas. State which tail, or both, is shaded.
  • Using sample statistics as if they were exact. The mean and standard deviation from 20 parts are estimates; the shaded tail inherits their uncertainty.

Frequently asked questions

What is the difference between a distribution plot and a histogram?

A histogram shows your data. A distribution plot shows a theoretical distribution with parameters you choose. You can compare them by overlaying a fitted curve on a histogram.

How do I find the area under a normal curve?

Use the cumulative distribution function: NORMCDF(x, mean, sd) gives the area to the left of x, and 1 - NORMCDF(x, mean, sd) the area to the right. See probability distributions for the other distributions.

What is a critical value on a distribution plot?

The x value that cuts off a chosen tail area, such as 2.5% in each tail for a two-sided test at 5%. It comes from the inverse CDF, for example TINV(0.975, df).

Can a distribution plot show discrete distributions?

Yes. For the binomial or Poisson it draws bars at whole numbers, and each bar's height is a probability.

Try it with your own data

StatLab SPC is free, open-source statistics for engineers. It runs in your browser, works offline, and never uploads your data.

Open StatLab