Histogram

Frequency distribution with boxplot and statistics

Anatomy of a Histogram

A histogram shows the frequency distribution of a numeric variable. Values are bucketed into equal-width classes (bins); the height of each bar equals the number of observations in that class. It is one of the most important tools for visually characterizing a dataset.

Bins (classes): The number of bars controls how finely the distribution is resolved. Too few bins hide structure, too many produce a jagged picture. Rule of thumb: ⌈√n⌉ or the Sturges / Freedman–Diaconis rules.

Frequency vs. density: The Y axis shows either absolute frequencies (count) or densities (relative frequency per bin width). Density mode is required to overlay a theoretical distribution curve.

Normal curve: Optional overlay of a normal distribution with the same location (μ) and spread (σ) as the sample. Shows at a glance how closely the data matches the bell curve.

Specification limits: USL and LSL can be drawn as vertical lines. This lets you immediately judge whether the distribution lies within the tolerance — a first step before a formal Cpk analysis.

In short: a histogram shows location, spread, shape, and possible outliers of a sample — and should appear at the start of almost every data-driven analysis.

Typical Shapes

  • Bell-shaped, symmetric → normality is plausible.
  • Right-skewed (long right tail) → typical for processing times, waiting times, reaction times.
  • Left-skewed → rarer, often with upper saturation effects.
  • Two peaks (bimodal) → mixed populations — e.g. two machines, two shifts — stratify the data.
  • Plateau / rectangle → uniform distribution or a mix of several sources with similar frequency.
  • Comb pattern with regular gaps → rounding or measurement resolution — check the scale or instrument.
  • Isolated bars far out → outliers.
  • Distribution "cut off" at USL/LSL → data was filtered beforehand or the instrument has a hard limit.

Pitfalls

Too few data points: With n < 30 the shape is only weakly reliable. Random gaps can look like bimodality, smooth bells can still hide non-normal shapes.

Bin count shapes the picture: The same sample looks completely different with 5 or 50 bins. For important statements, test several bin counts before committing to an interpretation.

Histogram ≠ normality test: A bell shape is an indication, not a proof. Before Cpk or t-test applications, verify with a probability plot or formal test.

Missed mixed populations: A single peak can be produced by two very close means. If stratification attributes exist (shift, machine), display the data separately.

Discrete data in a continuous histogram: Count data or rounded values create characteristic gaps. For discrete data, bar charts or Pareto are more appropriate.

Examples

This module ships with the following example datasets — load any of them in the app with a single click.

Bolt Diameter (capable) — Dataset
100 normally distributed measurements around μ ≈ 10.00 mm with σ ≈ 0.05 mm. Textbook capable-process example.
Shifted Process — Generator
Mean off-center (μ ≈ 10.08 mm) → low Cpk despite small dispersion.
Bimodal Process — Dataset
Mixture of two normal distributions around 9.93 and 10.07 mm. Violates the normality assumption of Cpk.
MSA Type 1: capable gage — Project template
25 repeated measurements of a 10.0 mm reference part (LSL 9.9 / USL 10.1, T = 0.2 mm). Very small spread, negligible bias → Cg ≈ 3.8 and Cgk ≈ 3.8 well above the 1.33 threshold. Textbook capable-gage case.
MSA Type 1: marginal gage — Project template
25 repeated measurements with moderate spread and slight positive bias. Cg ≈ 1.5 just above the 1.33 threshold, Cgk ≈ 1.0 just below — bias pulls capability down. Classic case for the role of Cgk alongside Cg.
MSA Type 1: incapable gage — Project template
25 repeated measurements with large spread and noticeable bias. Cg ≈ 0.6 and Cgk ≈ 0.3 — gage clearly fails the capability threshold. Textbook case for a measurement system that must be rejected.
Box-Cox I-MR chart: lognormal lifetimes — Project template
50 lognormally distributed lifetimes. A plain I-MR chart raises false alarms because of the right skew. After Box-Cox transformation (λ ≈ 0) the residuals become approximately normal.
Bolt diameter with outliers (Grubbs) — Project template
30 bolt diameters from N(10.000, 0.050) with two seeded outliers at 9.745 and 10.260 (≈ ±5σ). Grubbs (two-sided), generalized ESD and Tukey IQR should flag both.
Fit normal distribution — Project template
80 values from N(μ=10, σ=2) — clean textbook normal distribution. Shapiro-Wilk / Anderson-Darling should not reject H₀.
Fit Weibull lifetimes — Project template
80 component lifetimes from Weibull(k=2.5, λ=100 h). Classic wear-out case (β > 1); Weibull should rank as best fit.
Fit lognormal cycle times — Project template
80 cycle times from Lognormal(μ_log=ln 5, σ_log=0.6) — strongly right-skewed. Distribution-fit should rank lognormal first.
Fit exponential waiting times — Project template
80 waiting times from Exponential(μ=15 min) — memoryless distribution. Exponential and gamma rank highest.