Skip to content
svggage-components

Gauge R&R components

How much of the observed variation comes from the measurement system rather than the parts?

Demo data · seed 20261101 · 12 rows · default settings · 640 × 360SVG, lightSVG, darkDemo CSV

How to read it

  1. Read each cluster as one variance source, by three measures.
  2. Compare gauge R&R with the 10% and 30% guidelines.
  3. Part-to-part should dominate if the gauge is good.
  1. Callout 1: Gauge R&R: the measurement system.
  2. Callout 2: Part-to-part: what you want to see.
  3. Callout 3: Guidelines: below 10% is good, above 30% is not.

Watch out

  • Too few parts or operators make these percentages very uncertain.

Defaults

No settings: the chart draws one way.

Pinned in the code

  • Draws the run's numbers as given (computed by the Python/R engine); the chart computes nothing statistical.
  • Values are percentages (fractions ≤ 1.5 are scaled to percent). % contribution is on the variance scale and sums to 100; % study variation is on the SD scale (6σ) and does not.
  • AIAG guidelines on % study variation: under 10% acceptable, 10–30% may be acceptable, over 30% unacceptable; the engine also reports the number of distinct categories.
# Gauge R&R components — Codesplash Chart Lab (recipe "gage-components")
# controls: defaults
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import to_rgba

try:
    import codesplash as cs  # optional: the app's chart theme
except ImportError:
    cs = None
if cs:
    cs.use_codesplash(dark=False)
PALETTE = cs.palette(dark=False)["categorical"] if cs else plt.rcParams["axes.prop_cycle"].by_key()["color"]
# non-colour encodings per series (same table as the app: series are never told apart by colour alone)
SERIES_HATCHES = ["", "////", "..", "\\\\\\\\", "---", "xx", "|||", "++"]
HATCH_INK = to_rgba(plt.rcParams["axes.facecolor"], 0.5)  # stripes let the chart surface show through

df = pd.read_csv("gage-components-demo.csv", keep_default_na=False, na_values=[""])  # demo data (only empty cells are missing): Chart Lab → Code → Download demo CSV
df["source"] = pd.Categorical(df["source"].astype("string"), categories=["Gauge R&R", "Repeatability", "Reproducibility", "Part-to-part"])
df["measure"] = pd.Categorical(df["measure"].astype("string"), categories=["contribution", "study_var", "tolerance"])

def levels_of(s):
    """Declared level order (categoricals), else order of first appearance."""
    if isinstance(s.dtype, pd.CategoricalDtype):
        return [v for v in s.cat.categories if (s == v).any()]
    return list(dict.fromkeys(s.dropna().astype(str)))
S = "source"
V = "percent"
ME = "measure"
d = df.dropna(subset=[S, V]).copy()
d["_m"] = d[ME].astype(str) if ME else "contribution"
scale = 100 if d[V].max() <= 1.5 else 1  # fractions → percent
sources, measures = levels_of(d[S]), levels_of(d["_m"])
w = 0.8 / len(measures)
fig, ax = plt.subplots(figsize=(8, 4.5))
for j, m in enumerate(measures):
    vals = [d.loc[(d[S].astype(str) == str(s)) & (d["_m"] == m), V].sum() * scale for s in sources]
    ax.bar(np.arange(len(sources)) + (j - (len(measures) - 1) / 2) * w, vals, width=w * 0.95, color=PALETTE[j % len(PALETTE)], label=m, hatch=SERIES_HATCHES[j % 8], hatchcolor=HATCH_INK, linewidth=0)  # texture per measure, as in the app
for t in (10, 30):  # AIAG guidelines
    ax.axhline(t, color="grey", linestyle="--", linewidth=1)
ax.set_xticks(range(len(sources)), [str(s) for s in sources])
ax.set_ylabel("percent")
ax.legend(fontsize=8)
plt.show()

Needs pandas, numpy, matplotlib · reads gage-components-demo.csv · app theme from the optional codesplash helper