Election 2019: the result in Scotland in numbers
With the 2019 general election in the books, what are the key numbers behind the result in Scotland?
First of all, here are the headline figures:
The SNP won 48 seats (but will only have 47 MPs - more on that later), and were runners up in the 11 others. Their 45% of the vote yielded 80% of the seats.
The Conservatives won six seats and were runners up in 20, with their 25.1% of the vote netting them 10% of the seats.
Labour held on to just one seat and were runners up in 25 - their 18.6% of the vote landing them only 1.6% of the seats.
And the Lib Dems won four seats and were in second place in two others, taking 6.8% of the seats with 9.5% of the vote.
The first past the post electoral system used in Westminster elections played a significant role, with Labour's thinly-spread vote costing them in comparison to the Lib Dems, who profited from their support being more concentrated.
Had the election been run under a system of proportional representation, it would have seen the SNP take 27 seats, the Tories 15, Labour 11, and the Lib Dems 6.
Overall, the recent period of political turbulence continued.
A total of 15 seats changed hands, which is the third highest total in any general election in Scotland since 1945 - behind only the 2015 (50) and 2017 (21) results.
Marginal no longer
Going into this election Scotland had a remarkably high incidence of marginal seats, with 46 out of the 59 MPs defending a majority slimmer than 10%.
After the SNP's surge we're now down to 22 seats with single-digit majorities, with only five of them truly on a knife edge with fewer than 1,000 votes in it.
The tightest contests were between the SNP and the Lib Dems - the SNP's 149-vote victory over Jo Swinson in East Dunbartonshire being the most marginal of all.
At the other end of the scale, Scotland went into this election with only two MPs having a majority of more than 20%. Now, 18 seats have that comfortable a margin - all but one of them SNP.
There were 10 SNP candidates who won more than 50% of all the votes cast in their constituency - none of them managed that in 2017.
Kirkcaldy complications
The SNP totals are complicated because the party technically is credited with winning 48 seats, but will start the new parliament with 47 MPs.
This is because they suspended their candidate for Kirkcaldy and Cowdenbeath - Neale Hanvey - over his use of anti-Semitic language on social media, only for him to take the seat from Labour anyway.
This was a distinctly strange race - Lesley Laird, who was Labour's shadow Scottish secretary, gained the seat in 2017 despite losing votes on the previous time out. She has now relinquished the seat to Mr Hanvey, despite him also losing votes on the last election - this was the only seat where the nominal SNP vote share went down, it just didn't go down by nearly as much as the Labour vote.
Somehow the first, second and third place parties actually all lost votes in this constituency compared to 2017, despite turnout being up.
Talking of turnout it was up in almost every seat, with only 10 recording fewer voters than in 2017. The highest turnout was in East Dunbartonshire, where 80.3% of the local electorate cast their judgement on Jo Swinson.
Labour pains
The loss of the shadow Scottish secretary to a (sort of) independent MP might have been the peak of Labour's embarrassment on a bad night in Scotland, but the picture was bad everywhere.
In Aberdeen North - now the safest seat in Scotland, with the SNP's Kirsty Blackman sitting on a 33.9% majority - they finished third behind a candidate who was dropped by the Conservatives in mid-November. The party's share of the vote was down in every seat in the country, with scale of the the percentage-point fall into double digits in 16 seats.
Labour lost their deposit in six seats - up from zero in 2017 - representing fully half their total of lost deposits across the UK.
The Lib Dems meanwhile lost their deposit in 13 seats, having only got it back in 13 in 2017. Their share of the vote was up in almost every seat in Scotland - not that it will be much consolation having lost their leader.
None of the 22 Green candidates, 15 Brexit Party representatives and the seven from UKIP managed to get 5% of the vote to get their deposit back.
Of the 15 candidates who appeared on the ballot paper for the Brexit Party, the one who garnered the most votes was the one the party had disowned early in the campaign over social media comments.