Case Study 2 — Drawing a Test Match: Headingley 2019
Setup
The classic cricket charts of Chapter 7 was built for one-day cricket. Manhattans, worms and run-rate charts all assume a fixed number of overs, two innings and a target that is known from the first ball of the chase. A Test match has none of those. It has four innings of unlimited length, a lead that changes hands, and a result that can be a win, a loss, a draw or a tie, decided over as many as five days.
So what does a good chart of a Test match look like?
Imran Qureshi, who runs analytics for the fictional Headingley Road CC in Leeds, has a favourite test case for that question, and it happens to have been played a short walk from his club: the third Test of the 2019 Ashes, England v Australia at Headingley, 22–25 August 2019 (Cricsheet match id 1152848). Australia made 179; England were bowled out for 67; Australia made 246; England, set 359, won by one wicket. Imran's challenge to Nusrat is simple: "Draw me that match so that someone who has never heard of it understands what happened in ten seconds."
The data
From code/case_study_02.py:
England v Australia, Headingley, 2019-08-22 — England won by 1 wicket
Innings 1: Australia 179/10 (52.1 ov)
Innings 2: England 67/10 (27.5 ov)
Innings 3: Australia 246/10 (75.2 ov)
Innings 4: England 362/9 (125.4 ov)
By innings
runs legal wkts run_rate balls_per_wkt
innings
1 179 313 10 3.43 31.3
2 67 167 10 2.41 16.7
3 246 452 10 3.27 45.2
4 362 754 9 2.88 83.8
England's lead at the end of innings 1: -179 (after 52.2 match overs)
England's lead at the end of innings 2: -112 (after 80.0 match overs)
England's lead at the end of innings 3: -358 (after 155.3 match overs)
England's lead at the end of innings 4: +4 (after 281.0 match overs)
Fourth-innings target: 359
(Cricsheet does not store a target for Tests, so the script computes it: Australia's two totals, minus England's first innings, plus one. "Match overs" count legal balls ÷ 6 across all four innings.)
The fourth innings, wicket by wicket:
4th inns: wicket 1 fell at 15 — needing 344 more
4th inns: wicket 2 fell at 15 — needing 344 more
4th inns: wicket 3 fell at 141 — needing 218 more
4th inns: wicket 4 fell at 159 — needing 200 more
4th inns: wicket 5 fell at 245 — needing 114 more
4th inns: wicket 6 fell at 253 — needing 106 more
4th inns: wicket 7 fell at 261 — needing 98 more
4th inns: wicket 8 fell at 286 — needing 73 more
4th inns: wicket 9 fell at 286 — needing 73 more
And its partnerships and batting:
Fourth-innings partnerships
wicket batter_a batter_b runs balls runs_a runs_b extras
1 RJ Burns JJ Roy 15 36 7 8 0
2 JJ Roy JE Root 0 3 0 0 0
3 JL Denly JE Root 126 318 50 64 12
4 BA Stokes JE Root 18 108 3 13 2
5 JM Bairstow BA Stokes 86 130 36 34 16
6 JC Buttler BA Stokes 8 19 1 7 0
7 BA Stokes CR Woakes 8 22 7 1 0
8 BA Stokes JC Archer 25 54 10 15 0
9 SCJ Broad BA Stokes 0 2 0 0 0
10 MJ Leach BA Stokes 76 62 1 74 1
England batting, fourth innings
runs balls fours sixes strike_rate
batter
BA Stokes 135 219 11 8 61.64
JE Root 77 205 7 0 37.56
JL Denly 50 155 8 0 32.26
JM Bairstow 36 68 4 0 52.94
...
MJ Leach 1 17 0 0 5.88
Last-wicket stand: 76 runs off 62 balls — MJ Leach 1, BA Stokes 74, extras 1
Ben Stokes's 135 is the figure you will find in the official record too; as always, Cricsheet can occasionally differ from official scorecards by a run for older matches, so treat the ball-by-ball totals as "in the Cricsheet data".
Analysis
Why the one-day charts fail
Try the chapter's charts one at a time.
A Manhattan of the fourth innings would have 126 bars, almost all between 0 and 6 runs. The run rates of the four innings (3.43, 2.41, 3.27, 2.88) are not very different; the Manhattan would show four similar, flat skylines and miss the match entirely.
A run-rate chart for the chase is possible — England needed 359 with no limit on overs — but there is no "balls remaining", so there is no required rate. In a Test chase, the clock is the number of overs left in the match (which depends on weather and the time of day) and, far more importantly, wickets in hand.
What does separate the innings is in the last column of the "By innings" table: balls per wicket. England's first innings lasted 16.7 balls per wicket; their fourth lasted 83.8. In Test cricket, survival is the story. That points toward three charts.
Chart 1 — four worms on one axis
Plot each innings' cumulative runs against overs into that innings, first innings solid and second dashed, with the target as a horizontal line.
Chart 2 — the match worm (the lead)
A Test is one contest across four innings, so draw it as one line: England's running lead (+) or deficit (−) after every ball of the match, against overs into the match. Each Australian run pushes the line down; each English run pushes it up.
sign = np.where(m["batting_team"] == "England", 1, -1)
m["lead"] = np.cumsum(sign * m["runs_total"].to_numpy())
m["match_overs"] = m["is_legal"].cumsum() / 6
np.cumsum adds up the signed runs ball by ball across the whole match, so the line carries straight on from one innings to the next.
Chart 3 — partnership bars for the fourth innings
charts.partnership_bars(m, 4) works unchanged on a Test innings. That is the one chart from the one-day repertoire that transfers perfectly.

📊 Figure (described): Top left: cumulative runs against overs into the innings for all four innings — Australia blue, England orange, first innings solid and second dashed — with the target of 359 as a dotted line; England's first-innings line stops at 67 after 27.5 overs, and their fourth-innings line climbs slowly for 125 overs before a steep final rise to 362. Top right: England's lead ball by ball across the match, shaded orange below zero; it falls to −179, recovers slightly to −112, plunges to −358 at the start of the fourth innings, then climbs back to cross zero at the very end. Bottom: England's ten fourth-innings partnerships, led by Denly–Root's 126 off 318 balls and the last-wicket 76 off 62 in which Leach scored 1 and Stokes 74.
What the three charts say together
The match worm is the ten-second chart. A reader who has never heard of Headingley 2019 sees a line fall to almost −360 and climb back to zero on the last ball. That shape is the story. Annotated with one callout — "England −358, needing 359" — it passes Kavya's thumb test.
The four worms explain the shape. England's 67 is a line that stops almost before it starts. Their fourth innings is the longest line on the chart, flat for long stretches (Denly and Root added 126 off 318 balls, 2.38 an over) and then near-vertical at the very end.
The partnership bars locate the miracle. England were 286/9, needing 73. The tenth bar shows the last-wicket stand: 76 off 62 balls, Stokes 74, Jack Leach 1 off 17 balls, extras 1. A partnership chart makes the split instantly visible — a nearly all-orange bar with a sliver of blue — in a way that "Stokes 135 not out" on a scorecard does not. Leach's contribution was not runs; it was survival: 17 balls faced without being dismissed while Stokes scored.
Format lessons
- Plot survival, not just scoring. Wickets and balls per wicket matter more in Tests than runs per over.
- One line for the match. The lead chart turns four innings into one contest. It is the Test equivalent of the T20 worm-plus-target.
- Partnerships travel. The partnership chart is the only one-day chart that works unchanged in all three formats.
- Time is not overs. A real Test chart would also show days and sessions. Cricsheet has the match dates but not session breaks, so session charts need a proxy (blocks of overs) and an honest note.
What it means (and doesn't)
The charts show what happened, and they show it well. They cannot show the things that made Headingley 2019 famous beyond its numbers: the field placements Australia chose with England nine down, the review decisions of the final hour, the noise of the crowd. None of that is in ball-by-ball data. Nor can they say how unlikely the win was. "England −358 needing 359, nine down at 286" feels hopeless, but a statement like "England had an X% chance of winning at 286/9" requires a fourth-innings win-probability model — a much harder problem in Tests than in T20, because draws, time and the state of the pitch all matter. Chapter 29 and Chapter 33 come back to those questions.
Finally, one match is one match. The charts describe Headingley 2019; they do not tell you that "tail-enders can survive" or that "chasing 359 is possible" in general. For that you would need all fourth-innings chases in the data, drawn as small multiples or summarised as a distribution.
Discussion questions
- Why is "balls per wicket" a better headline number for comparing England's two innings at Headingley than run rate?
- The match worm uses England's lead. Would it be equally good to plot Australia's lead? What changes, and what stays the same?
- The Denly–Root stand was 126 off 318 balls. On a T20 partnership chart that would look slow. How should a reader judge it in a fourth-innings chase of 359?
- Leach scored 1 run off 17 balls in a match-winning stand. Which chart in this chapter shows his contribution best, and which would hide it?
- Design (in words) a chart for a drawn Test. What would the match worm look like, and what else would you need to show?
Your turn
Run code/case_study_02.py. Then pick another famous fourth-innings chase in the data — for example, search the tests_male matches for wins by the side batting fourth with a target above 300 — and draw the same three charts for it. Write a 300-word "ten-second" caption for its match worm, with one annotation. Finally, compare the shapes: how does your chase's match worm differ from Headingley's, and what does the partnership chart add?