Carry lower and upper endpoints with every estimate, and never relabel arbitrary spread as uncertainty.
Asymmetric error bars: tell readers what each endpoint means
The interval needs a type
An error bar may encode a standard deviation, a confidence interval, a prediction interval, an instrument tolerance or a minimum-to-maximum range. These answer different questions. Put the interval type, level where applicable, method and sample size in the chart caption. Uncertainty displays explain why a narrow-looking interval does not automatically mean a precise individual prediction. A bar without that contract invites the reader to supply the wrong interpretation. If the calculation is model-based, identify the population and conditions under which it applies.
Keep the endpoints, not just a radius
Some intervals are asymmetric around the estimate, especially near natural boundaries or after a nonlinear transform. Export estimate, lower and upper as three separate numbers. A renderer may ask for downward and upward distances, which can be derived from those endpoints without losing meaning. An estimate outside its own stated interval is a data error for many common interval definitions and should be stopped or explained. Forecast fan charts make this distinction even more important because uncertainty often widens with horizon.
Draw limits honestly
If an endpoint falls beyond the plotted axis, do not clip it silently. Extend the axis, use a visible arrow with the endpoint value, or choose another layout. A log axis cannot display zero or negative endpoints; transforming the point and interval requires the same transformation applied to both, with the method stated. Log and symmetric-log scales are not cosmetic switches. The chart should show whether a bound is physical, statistical or merely the display edge.
Compare groups without overclaiming
Overlap of two intervals is not a general significance test, and non-overlap is not the only way to establish a difference. If the decision concerns the difference between groups, estimate and plot that difference with its own interval. Signed differences put zero at the relevant comparison point. Check whether the same subjects appear in both groups; paired data require a paired calculation. For accessible reading, list each estimate and its endpoints in text, with units and the interval definition repeated where the chart may be shared alone.
Worked contract
from math import isfinite
def errorbar_distances(rows: list[tuple[str, float, float, float]]
) -> list[tuple[str, float, float, float]]:
names = [name for name, _, _, _ in rows]
if len(names) != len(set(names)) or any(not name for name in names):
raise ValueError("estimate labels must be unique and nonempty")
output = []
for name, estimate, lower, upper in rows:
if not all(isfinite(value) for value in (estimate, lower, upper)):
raise ValueError("estimate and bounds must be finite")
if not lower <= estimate <= upper:
raise ValueError("estimate must lie within its interval")
output.append((name, estimate, estimate - lower, upper - estimate))
return output
service_intervals = errorbar_distances([
("priority queue", 81, 59, 113),
("standard queue", 97, 83, 149),
])
assert service_intervals == [
("priority queue", 81, 22, 32),
("standard queue", 97, 14, 52),
]Performance and operating cost
Preparing N intervals takes O(N) time and O(N) output space. The code validates geometry but cannot establish that endpoints were calculated with the right statistical method. Keep the original endpoints and method metadata even if the chart library wants only positive distances. Avoid computing an interval from a small sample with an unverified shortcut just because the renderer accepts two numbers.
Common Mistakes
- Calling a range or standard deviation a confidence interval.
- Forcing asymmetric endpoints into equal visual arms.
- Clipping a bound at the axis edge without a marker or label.
- Inferring a group-difference test only from overlap of separate intervals.
Validation drill
Show 59 response-time estimates with asymmetric intervals. Identify five bounds outside the current axis and revise the view without hiding those endpoints.
Read next
- Uncertainty on charts: show denominators and intervals beside estimates
- Forecast fan charts: label interval meaning and forecast horizon
- Logarithmic axes: disclose zero handling and the linear threshold
- Diverging bars: put signed differences on one shared zero
