Sub topic 5
What a Pareto Chart Contains
A Pareto chart looks like an ordinary bar chart with a line over it. Each part of it has a job, and a chart that gets one of those jobs wrong can mislead you. This chapter names every part, explains what it encodes, and covers the layout rules and edge cases that decide whether the chart can be trusted.
This chapter assumes you can compute a cumulative sum and a percentage, you know how a bar chart encodes counts as heights, and you can read short pandas and matplotlib snippets. Earlier chapters covered counting problems by category and computing cumulative percentages. The next chapter walks through building a chart from raw data.
The chart at a glance
A Pareto chart combines two views of one data set:
- Bars show how large each category is. They are sorted from largest to smallest.
- A line shows the running total as a percentage of everything. It climbs from the first bar toward 100 percent.
The two views share one horizontal axis, the categories, but use two vertical axes.
The components, one by one
The categories on the horizontal axis
Each category is a mutually exclusive type of problem, such as "Scratches" or "Wrong label". The order is part of the chart's meaning, so it is not decorative. The categories run from the largest value on the left to the smallest on the right. That ordering makes the biggest contributors the first thing the eye lands on. It also guarantees that the cumulative line is concave. The line rises steeply at first and flattens as the bars shrink.
The "Other" bucket is the one exception. It collects the small categories that are not worth their own bar. By convention it goes last, even when its value is larger than some bars to its left. Placing it by size would split the sorted sequence and would make the line's slope hard to read, because a catch-all is not a single cause you can act on.
The bars and the left axis
The bar heights show the measure for each category. The measure is either a count (how many defects) or a cost (how much money they caused). The left axis starts at zero and is labeled with the measure and its unit, for example "Defect count" or "Rework cost (USD)". A bar chart that does not start at zero distorts the comparison, and that matters more here than usual because the whole point is to compare bar sizes.
In the classic layout the bars touch each other, with no gaps. This signals that the categories together make up one whole and are ranked, not independent items. Software defaults often leave gaps, and that is acceptable as long as the order is correct.
The cumulative line and the right axis
The line shows, at each category, the combined share of that category and every category to its left. For the example data used in this tutorial, the counts are 42, 27, 11, 8, 5, and 7 for "Other". The total is 100, so the cumulative percentages are:
| Category | Count | Share | Cumulative percentage |
|---|---|---|---|
| Scratches | 42 | 42% | 42% |
| Misalignment | 27 | 27% | 69% |
| Wrong label | 11 | 11% | 80% |
| Cracks | 8 | 8% | 88% |
| Discoloration | 5 | 5% | 93% |
| Other | 7 | 7% | 100% |
The right axis runs from 0 to 100 percent and is labeled as a percentage. It must always span the full range. If the right axis ends at, say, 90, the line appears to flatten out earlier than it really does, and the last point no longer shows "everything".
The line's last point is always exactly 100 percent. If it is not, a category is missing or the percentages were computed against the wrong total.
The 80 percent reference line
Many Pareto charts add a horizontal line at 80 percent. It is a reading aid. You look for where the cumulative line crosses it, and the categories to the left of that crossing are your candidates for the vital few. The 80 percent value comes from the 80/20 rule, which is a rough pattern and not a law. Some teams use 70 or 90 percent. Treat the line as a guide and label it clearly.
In the example, the line reaches exactly 80 percent at "Wrong label", so three of six categories account for 80 percent of the defects.
Title, labels, and context
A Pareto chart is a snapshot, so the reader needs to know what it covers. Include:
- A title that names what is counted ("Defects by type").
- The period and the scope, such as "Line 3, March inspections".
- The total, such as "n = 100 defects", so the reader can judge how much data stands behind the bars.
- Units on both axes.
Without the period and total, nobody can compare this chart to a later one. The before/after comparison later in the plan depends on this information.
The two axes must agree
The easiest mistake to make in anatomy is letting the two vertical axes drift apart. There is a property that makes a correct Pareto chart easy to read. The left axis should run from 0 to the grand total, and the right axis should run from 0 to 100 percent. Then the top of the left axis and the top of the right axis mean the same thing, which is "everything".
With that alignment, the first point of the line sits exactly at the top of the first bar. The second point sits at the top of the stack of the first two bars, and so on. You can check any point by eye: the line is the staircase of bar heights added together.
Many default plotting calls skip this step. The left axis then stretches to just above the tallest bar, and the line floats unrelated to the bar tops. The chart is still computed correctly, but a reader can no longer verify it visually.
The code below draws a chart with the axes aligned. It uses the same data as before. Matplotlib places categories at integer positions 0, 1, 2, and so on, which is why the annotation loop can use those positions.
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.ticker import PercentFormatter
defects = pd.Series({
"Scratches": 42,
"Misalignment": 27,
"Wrong label": 11,
"Cracks": 8,
"Discoloration": 5,
"Other": 7,
})
# Sort descending, keep "Other" last
main = defects.drop("Other").sort_values(ascending=False)
data = pd.concat([main, defects[["Other"]]])
total = data.sum()
cum_pct = data.cumsum() / total * 100
fig, ax = plt.subplots(figsize=(8, 4.5))
# Bars: touching, left axis from 0 to the grand total
ax.bar(data.index, data.values, width=1.0, color="C0", edgecolor="white")
ax.set_ylim(0, total)
ax.set_ylabel("Defect count")
ax.tick_params(axis="x", rotation=30)
# Line: right axis from 0 to 100 percent
ax2 = ax.twinx()
ax2.plot(data.index, cum_pct.values, color="C1", marker="o")
ax2.set_ylim(0, 100)
ax2.yaxis.set_major_formatter(PercentFormatter())
ax2.set_ylabel("Cumulative share")
# 80 percent reference line
ax2.axhline(80, color="gray", linestyle="--", linewidth=1)
# Label each point with its cumulative percentage
for position, value in enumerate(cum_pct.values):
ax2.annotate(f"{value:.0f}%", (position, value),
textcoords="offset points", xytext=(0, -16), ha="center")
ax.set_title(f"Defects by type (n = {total})")
fig.tight_layout()
plt.show()The two lines that matter for alignment are ax.set_ylim(0, total) and ax2.set_ylim(0, 100). Remove the first one and the bars will look taller than they should relative to the line.
Edge cases that change how the chart looks
The standard anatomy assumes a data set with a clear drop-off. Real data often does not behave that way. These cases come up regularly.
Ties
Two categories with equal values can be placed in either order, and the line comes out the same at the second one. Break ties consistently, for example alphabetically or by the more serious category first, so repeated charts do not reshuffle for no reason.
A large "Other" bucket
If "Other" is larger than the first bar, the chart is telling you the categories are too coarse. Readers cannot act on a catch-all. A common guideline is to keep "Other" well below the smallest named category, or at least below the first bar, and to split it by re-examining the raw records. The chart will still draw, but its message is weak.
Too many categories
With 20 or more categories, labels collide and the tail bars become slivers. Two ways to handle this are:
- Merge the smallest categories into "Other" until you have roughly 6 to 10 bars.
- Show only the top N bars and compute the cumulative line against the full total, so the line does not reach 100 percent within the visible bars. Say so in the caption.
The second option is the one case where the line's last point may not be 100 percent. It must be labeled.
A flat distribution
If every category is about the same size, the bars barely descend and the cumulative line is nearly a straight diagonal. This is a valid result and an important one. It says there is no vital few, and a Pareto chart will not help you choose where to focus. The anatomy is unchanged, but the shape tells you the technique does not fit the data.
One dominant category
When one bar covers most of the total, the line jumps near 100 percent at the first point and the rest of the chart is nearly flat. You can read the answer immediately. It is often worth a second chart that breaks down only that dominant category.
A quick checklist for a correct chart
Before you trust a Pareto chart, check these points:
- Bars descend from left to right, with "Other" last.
- The left axis starts at 0 and, ideally, ends at the grand total.
- The right axis runs from 0 to 100 percent.
- The line's final point is at 100 percent, or the chart states that it shows only the top categories.
- The first line point sits at the top of the first bar.
- Title, period, scope, units, and the total count are present.
Exercise
A team's Pareto chart shows five bars with counts 30, 20, 10, 5, and 5 (no "Other" bucket). Compute the cumulative percentage at each bar. Then state what the left axis should span so that the line's first point sits at the top of the first bar.
Show answer
The total is 70. The cumulative counts are 30, 50, 60, 65, and 70, so the cumulative percentages are 30/70 = 42.9%, 50/70 = 71.4%, 60/70 = 85.7%, 65/70 = 92.9%, and 100%. The left axis should span 0 to 70, the grand total, while the right axis spans 0 to 100 percent. Then the first line point at 42.9 percent lands at height 30, the top of the first bar.
Exercise
In a chart you inherit, the bars are sorted alphabetically, the right axis ends at 90 percent, and "Other" is the tallest bar. List the three problems and say what you would change for each.
Show answer
First, alphabetical sorting breaks the Pareto structure, so sort by the measure from largest to smallest. Second, the right axis ending at 90 percent hides the final 100 percent point and flattens the line, so set it to run from 0 to 100. Third, a tallest "Other" bucket means the categories are too coarse, so go back to the raw records and split "Other" into named categories, then place whatever small remainder is left at the end.