Unit 03.00: What a truncated axis does to a difference
Truncating a bar chart's axis is the commonest way to mislead with a technically accurate chart.
The same data, four axis floors
Two values six units apart, drawn against four different baselines.
The code computes the apparent ratio at each.
VALUES = {"A": 102, "B": 108}
difference = VALUES["B"] - VALUES["A"]
print(f"actual values: A={VALUES['A']}, B={VALUES['B']}, difference={difference}")
print(f"B is {difference / VALUES['A']:.1%} larger than A\n")
print(f"{'y-axis starts at':>18} {'A bar height':>13} {'B bar height':>13} "
f"{'apparent ratio':>15}")
for floor in (0, 90, 100, 101):
a, b = VALUES["A"] - floor, VALUES["B"] - floor
print(f"{floor:>18} {a:>13} {b:>13} {b / a:>14.1f}x")
print("\nThe data never changed. The apparent difference went from 1.1x to 7x.")
# Truncating a bar chart's axis is the single most common way to mislead with
# a technically accurate chart. Bars encode length, so the length must start
# at zero. Lines encode position and may be truncated -- with the axis labelled.
The apparent difference goes from 1.1× to 7× while the data never changes. Every one of those charts is accurate, and three of them are misleading.
The reason is what the mark encodes. A bar encodes *length*, and length is read as proportional to value - so the length must start at zero. A line encodes *position*, which is why a truncated axis is legitimate for a line chart provided the axis is labelled.
The mistake this prevents
The mistake is accepting the default. Most tools choose limits to fill the space, which for bars with similar values produces a truncated axis automatically - so the misleading chart is the one you get by not deciding.
Takeaway
Bars encode length and must start at zero. Lines encode position and may be truncated, with the axis labelled. The default is usually truncated, so set it deliberately.
