Lewis Baston is author of Reggie: The Life of Reginald Maudling and several books about British general elections. He is a consultant on politics, elections and constituencies.

The general election of June 2017 was the second in a row in which there were a handful of constituencies that went against the national swing between the Conservative and Labour parties.

While Labour made 28 gains from the Conservatives, the Tories struck back in six constituencies, including the by-election seat of Copeland. The account was more even in 2015, when Labour’s ten gains were offset by eight losses to the Conservatives.

This cross-traffic has been fairly unusual in recent elections; elections where more than one or two seats flip in the ‘wrong’ direction tend to involve both small national swings and a political context where different regions or types of constituency react in very different ways, both of which applied in the last couple of elections but not for any other election since 1987.

These wandering sheep, which stray away from the track indicated by the sheepdogs of uniform national swing, are always interesting to me, more so than the dutiful bellwethers.

The outstanding Conservative gain from Labour in 2017 came in Mansfield, an achievement that has perhaps not been recognised enough because of the context of so many expected Conservative gains failing to materialise and the big swings to Labour in some of its targets.

It was also historic, in that it had never had a Conservative MP as such before and Labour had represented the seat since 1923 – even in the 1931 landslide when the party was down to 46 seats nationally. Mansfield’s local communities still reflect some of the divisions from the 1926 and 1984 miners’ strikes. Its new Tory MP Ben Bradley celebrated its mining and working class history in his maiden speech:

“Coalmining was the centre of local communities throughout much of the 20th century, not just for work but for all kinds of other support. It is a heritage of which people are rightly proud, and I shall be supporting calls for the creation of a new museum in the town centre to protect that heritage and ensure that future generations know and understand it.”

Although Mansfield was the leader, most of the other constituencies that went from Labour to Conservative in 2017 bear a family resemblance. North East Derbyshire, Stoke-on-Trent South, and Copeland are also ex-mining areas composed of tough little working class towns; Walsall North is similar, although its heritage is heavy industry rather than coal.

In all of these the Labour majority had worn thin in the 1987 election, suggesting that as well as movements triggered by the EU referendum and the changing culture of the main parties, there have been some longer-term shifts in these seats, as in once similar seats where the dramatic Tory gain came much earlier, in 1970 (Bosworth, Cannock, Belper/South Derbyshire) or 1983 (Sherwood).

Mansfield is the most counter-trend seat changing hands since 1964 – among Labour seats it was 49th most vulnerable to a pro-Tory swing from 2015, while most seats that have gone the ‘wrong’ way have involved overturning rather smaller majorities. The previous big outliers have been Battersea (Tory target number 42 in 1987) and Smethwick, a rather notorious win against the trend in target seat number 82 in 1964.

For some reason, the Conservatives seem better than Labour at gaining seats despite national headwinds, managing this in significant numbers in 1987, 2015 and 2017. Oddly enough, the general elections of 1959 and 1983, rather than any less dramatic reverse,s saw the best Labour counter-cyclical pick-ups, with localised swings in depressed industrial seats in the former and inner city seats – plus Gwyneth Dunwoody’s personal support in Crewe – in the latter.

Broadening the analysis of the outlying constituency gains and losses, what about the other end of the scale, the seats that have overdone the national swing?

The table below lists the far ends of the spectrum in gains and losses in the two-party marginals. There are some patterns in there. In some elections Scotland has gone its own way, either swinging contrary to England (1979, 1992) or going in the same direction but much more enthusiastically (1987).

The West Midlands was the cockpit of the bigger electoral swings of the 1959-79 era, when its politics was whipsawed by racial tension, stop-go economics, industrial unrest, and the strong following for Enoch Powell in the region. London has contributed a lot in recent elections, reflecting its regional distinctiveness and rapid social changes.

There are some seats that regularly produce extreme swings. The seat based on Cannock is extraordinarily volatile, having produced the best Conservative results in two elections with gains in 1970 (against Jennie Lee) and in 2010, but sometimes reverting strongly to Labour as in 1974 and 1992.

Its emphatic Tory swing in 2010 has been followed by two more, making Cannock Chase safer for the Conservatives, on the face of it, than Wycombe or Rushcliffe.

The other big swing seat that stands out is Stockton South, including its predecessors Teesside, Thornaby, and Middlesbrough West. It is the most middle-class and owner-occupied seat in the former county of Cleveland, full of swing voters in newly-built estates.

The electoral history of the area is full of reversals on swings of well over the national average in both directions, starting with a long-shot Tory gain in 1951 and continuing this year with a surprise win for Labour. While it has gone with the national winner in most elections, it cannot claim to be typical – but anyone interested in what determines general elections has to take notice of what makes Stockton South tick.

Combining the extreme results in the seats that are contested between Labour and the Conservatives gives a measure of the spread of gains and losses around the national mid-point. In each election, which is the most ambitious seat, furthest down the target list, that each of the two big parties wins?

In elections with one-way traffic the best result achieved by the losing party is to hold a marginal seat that might have fallen on the national average or the swing to be found in seats with similar or larger majorities, as with Gisela Stuart’s hold in Birmingham Edgbaston in 2010. In elections with two-way traffic between Labour and Conservative, one can compare seats that change hands in each direction, as in 2017 where Mansfield was the most ambitious Conservative gain and Kensington the furthest-out Labour gain.

The range is therefore a rough indicator of how variegated the results are overall. How, then, does 2017 measure up? The gap between Mansfield and Kensington, when you rank all the Conservative and Labour seats by one party’s lead over the other, is 146 seats.

If the Conservatives had held and won every seat up to Mansfield, they would have gained 49 from Labour and enjoy a three-figure majority. If Labour had held and won every seat down to Kensington, Labour would have won an overall majority of around twenty.

The 2017 dispersal was the largest since 1983, hinting that something interesting was going on with electoral behaviour (and the 1983 figure might not be completely reliable, as we depend on notional estimates for elections that follow boundary changes).

The most wild and woolly set of constituency results was in 1964, when the dispersal between the best Conservative gain (Smethwick) and the best Labour gain (Middlesbrough West) was 235 constituencies, a fantastic landslide either way if constituencies had marched in lockstep. In contrast to 2017, most other elections that have taken place after a short parliament have had fairly tightly-bunched results, as in October 1974 and 1966.

Taking yet another angle on electoral change, the extent to which the parties’ electoral coalitions were defined by the Thatcher and Blair landslides on each side is interesting. In the Tory upswing of 1979 and 1983 they gained 30 seats that they had not since at least 1935, of which 16 were still Conservative in the 2017 election. In Labour’s upswing from 1987 to 1997 they gained 43 fresh seats, of which 21 voted Labour in 2017.

The Conservatives’ gains in 2001, 2005, and 2010 involved remarkably little new territory, with only a by-election fuelled gain in Crewe and Nantwich breaking new ground (and even then, if the boundary change estimates are right, they would have won the seat on those boundaries had it existed in 1979). But each of the last two elections has involved Conservative breakthroughs (Morley and Outwood and Gower in 2015, five of the six in 2017). Labour won unprecedented victories in four seats in 2017, similar to 1987 and 1992 in this respect.

The 2017 election was startling. One can feel the tectonic plates moving, but if history is a guide there is more change yet to come.