In maps: How close was the Scottish referendum vote?
Scotland has voted against independence from the United Kingdom in an historic referendum.
Almost 85% of the electorate turned out to vote, an unprecedented proportion in recent decades.
The overall result was reached by simply adding together all ballots but data from the 32 Scottish council areas reveal differences in voting patterns.
How close was the result?
The overall result was slightly wider than predicted with 55% No to 45% Yes but the split varied across areas.
The closest result was Inverclyde with 50.1 No to 49.9% Yes.
John Curtice, professor of politics at Strathclyde University, said the result was not as close as opinion polls had been predicting.
"That is not uncommon in these referendums where people are being asked to make a big change. They often draw back at the last minute," he said.
An extraordinarily large turnout of 84.6% is the highest seen in recent decades. The last UK general election to come close was in 1951 with 83.9%.
To beat it means looking back to 1910 when women did not have the vote and many men were also disenfranchised.
Was the split on party lines?
The European election in May 2014 gives some indication of party political support across Scotland although the turnout was much lower than that for the referendum.
In May, the SNP had the largest vote share overall with Labour second.
In the referendum, three of the four areas to vote Yes had backed Labour in the European election.
Dundee was the exception, backing the SNP in May and voting Yes in the referendum.
Professor of politics at Edinburgh University, Charlie Jeffrey, said party loyalties did not seem to have mattered in the referendum vote.
He said: "We have seen results in Labour strongholds like Glasgow and North Lanarkshire where there has been a 'Yes' vote, and in SNP strongholds like Angus and Perthshire there has been a 'No' vote.
"What we have found is a very strong correlation between the Yes vote and a higher level of unemployment.
"But also a slightly less strong relationship between the more British you feel, the less likely you are to vote 'Yes'.
"These seem to be more significant influences than political party in the outcome."
The latest annual unemployment figures show North Ayrshire the worst affected with a rate of 13.5% of the adult population. This area returned a narrow No vote of 51%.
Some 109,533 youngsters aged 16 to 17 registered to vote after being given the chance to do so for the first time.
A snap poll by Lord Ashcroft asking voters how they had cast their ballots found this age group had voted overwhelmingly for independence, with 71% for Yes.
However among the wider 16-24-year-old age group the Yes vote was 51%, according to the poll.
Glasgow is the area with the biggest total population in Scotland and also has a high number of teen voters. Figures from the 2011 Census show the city had more than 18,000 people aged 13-15.
Depending on when their birthday falls, these youngsters will now be aged 16-19.
At the other end of the demographic spectrum is Scotland's rising older population. The proportion of people aged 65-plus now stands at 16.8%, slightly more than the proportion of under 16-year-olds.
Unsurprisingly, the issue of pensions consistently registered as one of the key issues in the independence debate.
Those areas with a relatively older population are the places where "No" did well.
The Lord Ashcroft overnight poll of 2,047 voters found that 73% over 65s chose No.